【发布时间】:2015-10-30 20:19:32
【问题描述】:
我不太确定webpack 中的publicPath 是做什么用的。具体来说,output.publicPath。在 github 文档中,我看到了这个
https://github.com/webpack/docs/wiki/configuration#outputpublicpath
Javascript/HTML 页面视图中的 output.path。
对于reactjs热加载,我有
output: {
path: path.resolve('./public/bundle/'),
// path: './public/bundle',
filename: 'main.js',
// Webpack dev server is bound to port 8080, we have to force use of absolute URL, using the publicPath property
publicPath: 'http://localhost:8080/public/bundle/'
},
这是否意味着构建好的webpack文件(main.js)放在了我的dev-serverhttp://localhost:8080/public/bundle/?
【问题讨论】:
标签: javascript reactjs webpack webpack-dev-server