文章详情页
node.js - webpack配置路径出错,各位大神帮忙看一下啊!!速度!!!
浏览:241日期:2023-10-01 15:54:21
问题描述
我的文件夹路径是这样的webpack下面包含这三个 dist src webpack.config.js
配置: emodule.exports={
entry:’./src/script/main.js’,output:{ path:’./dist/js’, filename:’bundle.js’}
}请问路径有错吗,总是报路径错误
问题解答
回答1:日志都跟你讲的很清楚了output的path需要是个绝对路径The output directory as an absolute path (required) 这是官方文档里讲的,你的日志里也提示你了这不是一个绝对路径。正确用法:
path: path.resolve(__dirname, ’./dist/js’)
标签:
web
排行榜
![$fields = $values = [];这条代码一直定义不了,一直报错,老师的源码也是被报错的,执行不了,请问该怎么解决这个问题](http://www.haobala.com/attached/image/news/202205/093622cb60.png)