-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwebpack.watch.js
41 lines (39 loc) · 1.23 KB
/
webpack.watch.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
var webpack = require('webpack');
var merge = require('webpack-merge');
var webpackConfig = require('./webpack.config.js');
var WriteFilePlugin = require('write-file-webpack-plugin');
// Read port from environment variable. See Makefile
const port = parseInt(process.env.DEV_SERVER_PORT);
// Webpack watch is run within the webpack devserver, therefore
// the public path is actually a localserver
module.exports = merge(webpackConfig(true, 'http://localhost:' + port + '/assets/'), {
module: {
loaders: [
{
test: /\.scss$/,
loaders: ['style-loader?sourceMap', 'css-loader?sourceMap', 'sass-loader?sourceMap']
}
]
},
performance: {
hints: false
},
devServer: {
headers: {
"Access-Control-Allow-Origin": "*",
},
host: '0.0.0.0',
compress: true,
inline: true,
port
},
devtool: 'eval-source-map',
plugins: [
// Webpack dev server keeps files in memory but for the application we need the manifest
// Forces the devserver to write the manifest
new WriteFilePlugin({
test: /webpack-manifest\.json/,
useHashIndex: false
})
]
});