webpack中的path是當我們build的時候,輸出項目打包文件的位置。
webpack中的publicPath是我們打算放到web服務器下的目錄,如果我們要放到網站的根目錄下,那么就無需設置。如果要放到站點的其它路徑,就可以通過設置publicPath來實現。
這樣當運行的時候,請求的其它js, css等資源,就會添加上這個路徑。
output: { path: helpers.root('dist'), filename: '[name].[chunkhash].bundle.js', sourceMapFilename: '[name].[chunkhash].bundle.map', chunkFilename: '[id].[chunkhash].chunk.js', publicPath: '/front/' },
