webpack打包的问题
来源:1-2 框架面试导学

lynhao
2021-09-24
老师你好, 我在你原先的demo上进行扩展,想将html中img标签中的图片让webpack给他抽离出来, 引入了一个html-loader
去解析, 然后提示这个错误
Error: Automatic publicPath is not supported in this browser
我查了下资料, 在output上加上publicPath: './'
, 然后又出现这个错误,
/******/ __webpack_require__.b = require("url").pathToFileURL(__filename);
^
ReferenceError: __filename is not defined
目前卡在这边,老师有空能帮忙看看吗蟹蟹啦, 链接在这里
https://github.com/lynhao/webpack-trouble/tree/master
写回答
1回答
-
双越
2021-09-24
设置 publicPath: '' 试试
012021-09-25
相似问题
css文件打包报错,没找到原因
回答 2
webpack 打包问题
回答 1