webpack dev服务器没有输出文件

时间:2017-02-15 02:22:57

标签: javascript reactjs webpack

我有一个像这样的目录

enter image description here

我有一个像这样的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

0 个答案:

没有答案