-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
47 lines (44 loc) · 1 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const SyncModuleIdsPlugin = require('webpack/lib/ids/SyncModuleIdsPlugin');
let plugins = [];
if (!process.env.IGNORE_MODULE_IDS) {
const path = require('path');
const lib = path.resolve(__dirname, 'lib');
const style = path.resolve(__dirname, 'style');
plugins.push(
new SyncModuleIdsPlugin({
path: 'webpack.module.ids.json',
mode: 'update',
test: (module) => {
const r = `${module.userRequest}`;
return r.indexOf(lib) === 0 || r.indexOf(style) == 0;
},
})
);
}
module.exports = {
output: {
clean: true,
},
devtool: 'source-map',
resolve: {
fallback: {
buffer: require.resolve('buffer/'),
},
},
module: {
rules: [
{
test: /\.js$/,
use: process.env.TOTAL_COVERAGE
? ['@ephesoft/webpack.istanbul.loader']
: ['source-map-loader'],
},
{
test: /zstd\.wasm/,
type: 'asset/resource',
},
],
},
ignoreWarnings: [/Failed to parse source map/],
plugins,
};