我正在使用带有Elm的webpack,并发现手表只能存活一组更改(事实上只要编译阶段成功,它就会继续观看,但只能在编译失败的情况下幸存下来。)
我已经尝试过OldWatchPlugin和increasing the watches(在Ubuntu和OSX上)。
我对webpack一点都不熟悉(但希望热重新加载),所以我的启动("webpack-dev-server --hot --inline --port 3000"
)或配置(下面)上的任何评论都会有所帮助。
var webpack = require('webpack');
module.exports = {
entry: './src/index.js',
output: {
path: './dist',
filename: 'index.js'
},
resolve: {
modulesDirectories: ['node_modules'],
extensions: ['', '.js', '.elm', '.scss', '.css']
},
module: {
loaders: [
{
test: /\.html$/,
exclude: [/ignore/, /node_modules/],
loader: 'file?name=[name].[ext]'
}, {
test: /\.elm$/,
exclude: [/ignore/, /elm-stuff/, /node_modules/],
loader: 'elm-hot!elm-webpack'
}, {
test: /\.scss$/,
exclude: [/ignore/, /elm-stuff/, /node_modules/],
loaders: ["style", "css", "sass"]
}, {
test: /\.css$/,
exclude: [/ignore/, /elm-stuff/, /node_modules/],
loaders: ["style", "css"]
}, {
// test: /\.(svg|png|jpg)$/,
test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
// include: [ /node_modules\/bootstrap-sass/, /src/],
// exclude: [/ignore/, /elm-stuff/],
// loader: 'url-loader?limit=10000'
loader: 'url-loader?limit=10000&name=[name]-[hash].[ext]'
}, {
test:/bootstrap-sass[\/\\]assets[\/\\]javascripts[\/\\]/, loader: 'imports?jQuery=jquery'
}
],
noParse: /\.elm$/
},
plugins: [
new webpack.OldWatchingPlugin()
],
devServer: {
stats: 'errors-only'
}
};