-
Notifications
You must be signed in to change notification settings - Fork 13
/
webpack.dev.js
42 lines (40 loc) · 956 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
const Path = require('path');
const Webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const dest = Path.join(__dirname, './dist');
module.exports = merge(common, {
mode: 'development',
devtool: 'cheap-eval-source-map',
devServer: {
contentBase: dest,
inline: true
},
plugins: [
new Webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})
],
module: {
rules: [
{
test: /\.(js)$/,
include: Path.resolve(__dirname, './src'),
enforce: 'pre',
loader: 'eslint-loader',
options: {
emitWarning: true,
}
},
{
test: /\.(js)$/,
include: Path.resolve(__dirname, './src'),
loader: 'babel-loader'
},
{
test: /\.s?css$/i,
use: ['style-loader', 'css-loader?sourceMap=true', 'sass-loader']
}
]
}
});