我在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'
}
};发布于 2016-05-31 08:58:34
这可能是由于recently fixed的一个bug造成的。至少升级到3.0.3版本应该可以解决问题。
https://stackoverflow.com/questions/36215305
复制相似问题