我有一个像这样的目录
我有一个像这样的webpack文件
module.exports = {
env : 'production',
debug: !prod,
devtool: !prod ? 'eval' : '',
context: path.join(__dirname, 'resources/assets/bundle/entries'),
entry: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
'./feed.js'
],
output: {
path: path.join(__dirname, 'public'),
publicPath: '/',
filename: 'main.js'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.ProvidePlugin({
React: "react"
})
]
}
为什么当我点击http://localhost:3000/main.js时找不到任何内容?在webpack中我确实看到webpack得到了feed.js,也许我的输出路径错了?没有权利? publicPath设置为' /',所以我实际上可以在http://localhost:3000/main.js中将捆绑的feed.js作为main.js