-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.config.js
58 lines (54 loc) · 1.24 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
48
49
50
51
52
53
54
55
56
57
58
var webpack = require('webpack');
var path = require('path');
var DEV_PORT = 3824;
module.exports = {
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:' + DEV_PORT,
'webpack/hot/only-dev-server',
'./src/index.js'
],
output: {
path: path.join(__dirname, 'public'),
filename: 'popup.js'
},
devtool: 'inline-source-map',
devServer: {
hot: true,
port: DEV_PORT,
contentBase: path.resolve(__dirname, 'extension'),
publicPath: '/'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
use: 'babel-loader',
exclude: /(node_modules|bower_components)/
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader', 'postcss-loader']
},
{
test: /\.svg$/,
loader: 'svg-react-loader',
exclude: /(node_modules|bower_components)/
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"'
}
})
]
};