var webpack = require('webpack');
module.exports = {
// devtool: 'source-map',
// devtool: 'eval-source-map',
debug: true,
devServer: {
contentBase: __dirname +'/src/endpoint',
colors: true,
noInfo: true,
host: '127.0.0.1',
port: 8000,
inline: true,
hot: true,
publicPath: '/static/'
},
context: __dirname + '/src',
entry: {
app: [
'es6-shim',
'reflect-metadata',
'./app/app'
]
},
output: {
path: __dirname + '/src/endpoint/static',
filename: '[name].js'
},
plugins: [
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{
test: /\.js$/,
exclude: [
/node_modules/
],
loader: 'babel',
query: {
stage: 0
}
}
]
}
};
这是我目前的设置。我不明白如何强制 webpack 监视特定文件?例如,我想在/\.html$/
更新任何文件匹配时触发编译。