qq_光荣之路_0
2017-09-16 00:26
Invalid configuration object. Webpack has been initialised using a configur
ation object that does not match the API schema.
- configuration.output.path: The provided value "./dist" is not an absolut
e path! 报错代码
配置文件代码
module.exports={
entry: './src/script/main.js',
output: {
path: './dist',
filename: 'bundle.js'
}
}
在最外面设置常量const path = require("path");然后在entry里面设置path:path.resolve(__dirname,"dist"),
改成绝对路径了。还是报错undle.js Failed to load resource: net::ERR_FILE_NOT_FOUND这是咋回事?
var path=require("path");
module.exports={
entry:"./src/js/app.js",
output:{
path:__dirname+"/dist",
filename:"bundle.js"
},
module:{
loaders:[
{test:/\.css$/,loader:"style-loader!css-loader"}
]}
}
修改配置信息以后css文件并没有编译。总是提示bundle。js没有找到资源。报错:index.html:11 GET file:///E:/aawebpack/bundle.js net::ERR_FILE_NOT_FOUND
以下是我修改的配置文件,请问这到底是怎么回事?
var path=require("path");
module.exports={
entry:"./src/js/app.js",
output:{
path:path.resolve(__dirname,"/dist"),
filename:"bundle.js"
},
module:{
loaders:[
{test:/\.css$/,loader:"style-loader!css-loader"}
]
}
}
output: {
path: './dist',
filename: 'bundle.js'
}
修改为:
output: {
path: __dirname+'/dist',
filename: 'bundle.js'
}
webpack深入与实战
86561 学习 · 721 问题
相似问题