报错 /******/ if (!scriptUrl) throw new Error(“Automatic publicPath is not supported in this browser”);
Error: Automatic publicPath is not supported in this browser
-
index.html:95
D:/fore-end/webpack/04-打包图片资源/src/index.html:95:33 -
index.html:98
D:/fore-end/webpack/04-打包图片资源/src/index.html:98:12 -
index.js:127 HtmlWebpackPlugin.evaluateCompilationResult
[fore-end]/[html-webpack-plugin]/index.js:127:28 -
index.js:305
[fore-end]/[html-webpack-plugin]/index.js:305:26 -
task_queues.js:97 processTicksAndRejections
internal/process/task_queues.js:97:5 -
async Promise.all
-
async Promise.all
-
报错原因:
打包资源后不能解析“./”之类的路径,需要通过publicPath配置。在原有的output基础上配置:publicPath: ‘./’
配置如下: