forked from Morikko/sync-tab-groups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
47 lines (45 loc) · 1.29 KB
/
webpack.dev.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 path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const plugins = [
new webpack.DefinePlugin({
'process.env.IS_PROD': false,
}),
new CopyWebpackPlugin([
{
from: 'node_modules/jasmine-core/lib/jasmine-core/*.*',
to: 'tests/jasmine-core/',
context: '../',
flatten: true,
},
{
from: 'node_modules/webextension-polyfill/dist/browser-polyfill.js',
to: 'lib/',
context: '../',
flatten: true,
transform: function(content, path) {
return content.toString().replace('//# sourceMappingURL=browser-polyfill.js.map', '')
},
},
]),
];
module.exports = {
entry: {
'tests/tests/unit/all.spec': './tests/tests/unit/all.spec.js',
'tests/tests/integration/all.spec': './tests/tests/integration/all.spec.js',
},
output: {
path: path.resolve(__dirname, './build'),
},
// FIX: Module not found: Error: Can't resolve 'fs'
node: { fs: 'empty' },
target: 'web',
mode: 'development',
plugins,
/**
* Only one that works on FF
* Issue on webpack: https://github.com/webpack/webpack/issues/1194
* Issue on web-ext toolbox: https://github.com/webextension-toolbox/webextension-toolbox/issues/58
*/
devtool: 'inline-source-map',
};