-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.config.js
44 lines (42 loc) · 976 Bytes
/
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
const path = require('path');
const webpack = require('webpack');
const dev_port = 31401;
module.exports = {
mode: 'development',
devServer: {
port: dev_port,
open: true,
hot: true,
},
entry: [
'babel-polyfill',
'./js/entry.jsx'
],
output: {
path: path.join(__dirname, '/'),
filename: 'bundle.js',
},
plugins: [
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin()
],
module: {
rules: [
{
test: /\.(js|jsx)$/, use: [{
loader: 'babel-loader',
options: {
presets: ['react', 'env'],
plugins: ['babel-plugin-syntax-dynamic-import']
}
}],
include: path.join(__dirname, './', 'js'),
},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.(png|jpg|gif|svg|brs)$/, use: {
loader: 'file-loader',
options: { name: 'files/[name]-[hash:8].[ext]' }}
}
]
}
};