如花公子
2017-11-13 15:31
config配置完之后运行webpack,提示“Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.output.path: The provided value "./dist/js/" is not an absolute path!“ 这个错误,是怎么回事
The provided value "./dist/js/" is not an absolute path!“
输出的路径必须是绝对路径了
输出路径得是绝对路径
const path=require('path'); //用node.js的 path对路径进行转换
path:path.resolve(__dirname+'/dist/js/')
运行webpack后成功打包
输出路径得是绝对路径
const path=require('path'); //用node.js的 path对路径进行转换
path:path.resolve(__dirname+'./dist/js')
运行webpack后成功打包
path 不对吧
path: __dirname+"/dist",
filename: "js/[name]-[chunkhash].js"
这是我的写法是可以的,你看下官网api,老师的是老版本呢,现在的版本语法有变化的
webpack深入与实战
86561 学习 · 721 问题
相似问题