-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
webpack.dev.js
36 lines (34 loc) · 1.1 KB
/
webpack.dev.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
const path = require( 'path' );
const CopyPlugin = require( 'copy-webpack-plugin' );
const webpack = require( 'webpack' );
const glob = require( 'glob' );
const contentScripts = name => glob.sync( `./src/content-scripts/${name}/*.js` );
module.exports = {
mode: 'development',
entry: {
'index': glob.sync( './src/options/*.js' ),
'content-scripts/main': contentScripts( 'main' ),
'content-scripts/lobby': contentScripts( 'lobby' ),
'content-scripts/missions': contentScripts( 'missions' ),
'content-scripts/team': contentScripts( 'team' ),
'content-scripts/my-matches': contentScripts( 'my-matches' ),
'content-scripts/profile': contentScripts( 'profile' )
},
devtool: 'source-map',
output: {
clean: true,
filename: '[name].js',
path: path.resolve( __dirname, './dist' )
},
experiments: { topLevelAwait: true },
plugins: [
new CopyPlugin( {
patterns: [ 'public', 'manifest.json', 'src/options/index.html', 'src/content-scripts/content.css' ],
options: {}
} ),
new webpack.ProvidePlugin( {
$: 'jquery',
jQuery: 'jquery'
} )
]
};