-
Notifications
You must be signed in to change notification settings - Fork 20
/
webpack.dev.js
48 lines (41 loc) · 933 Bytes
/
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
37
38
39
40
41
42
43
44
45
46
47
48
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'source-map',
entry: {
bundle: './src/js/index.js',
worker: './src/js/worker.js'
},
output: {
filename: '[name].js',
path: path.join(__dirname, '/build'),
},
module: {
rules: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['@babel/preset-react'],
}
}
]
},
plugins: [
new CopyWebpackPlugin([
{ from: './src/dev.html', to: './index.html' },
{ from: './src/*.css', to: './[name].[ext]' },
{ from: './src/img/**.*', to: './img/[name].[ext]' },
]),
],
devServer: {
historyApiFallback: {
rewrites: [
{ from: /^\/run\/.+/, to: '/index.html' },
{ from: /./, to: '/404.html' }
]
}
}
};