-
Notifications
You must be signed in to change notification settings - Fork 29
/
webpack.config.dev.js
54 lines (53 loc) · 1.41 KB
/
webpack.config.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
49
50
51
52
53
54
var path = require('path');
var webpack = require('webpack');
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'./example/index.js'
],
devServer: {
hot: false,
inline: true,
contentBase: './example_dist',
port: 8080,
disableHostCheck: true,
},
output: {
path: path.join(__dirname, './example/'),
filename: 'bundle.js',
publicPath: '/web-assets/dist/'
},
plugins: [
new webpack.DefinePlugin(
{
'process.env': {
'NODE_ENV': JSON.stringify('local'),
}
}
),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new OpenBrowserPlugin({ url: 'http://localhost:8000' })
],
resolve: {
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: ['babel-loader']
},
{
test : /\.scss$/,
use: ['style-loader', 'css-loader', 'resolve-url-loader', 'sass-loader?sourceMap']
},
{
test : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
use : 'file-loader'
}
]
}
};