-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.babel.js
73 lines (71 loc) · 1.97 KB
/
webpack.dev.babel.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import path from 'path'
import webpack from 'webpack'
import merge from 'webpack-merge'
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import DashboardPlugin from 'webpack-dashboard/plugin'
import BrowserSyncPlugin from 'browser-sync-webpack-plugin'
import common from './webpack.common.babel'
export default merge(common, {
devtool: 'inline-source-map',
mode: 'development',
output: {
path: path.resolve(__dirname, './src/public/dist/'),
filename: `[name].bundle.js`,
publicPath: '/'
},
module: {
rules: [
{
test: /\.(sc|c)ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
includePaths: [
path.resolve(__dirname, 'node_modules/')
]
}
},
'css-loader',
'sass-loader'
]
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin({ multiStep: true }),
new MiniCssExtractPlugin({
filename: '[name].bundle.css'
}),
new HtmlWebpackPlugin({
template: './src/html/template.html',
inject: 'body'
}),
new BrowserSyncPlugin({
host: '0.0.0.0',
port: 3001,
proxy: 'http://localhost:3000/',
reload: false,
open: false
})
],
devServer: {
headers: {
'Access-Control-Allow-Origin': '*'
},
contentBase: './src/public',
compress: true,
host: '0.0.0.0',
port: '3000',
bonjour: true,
hot: true,
historyApiFallback: true,
inline: true,
clientLogLevel: 'error',
watchOptions: {
aggregateTimeout: 500,
poll: 1000
}
}
})