我在我的服务器中使用 webpack-dev-middleware 来编译 javascript,如下所示:
if (development){
app.use(webpackMiddleware(webpack({
// webpack options
// webpackMiddleware takes a Compiler object as first parameter
// which is returned by webpack(...) without callback.
entry: {
dashboard: path.join(__dirname, 'scripts/dashboard.jsx'),
tasks: path.join(__dirname, 'scripts/tasks.jsx')
},
output: {
path: __dirname + 'dist',
filename: '[name].bundle.js',
// no real path is required, just pass "/"
// but it will work with other paths too.
},
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{ test: /\.jsx$/, loader: "jsx" }
]
}
}
),
{
stats: {
colors: true
}
}));
}
在开发中一切正常,我可以在我的视图中包含捆绑包。但是在生产中我不能包含它们,因为它们没有构建到“dist”中。此文件夹始终为空。我做错了什么?有人有想法吗?
最好的问候