配置路徑出錯 不是絕對路徑
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'
}
}
2017-09-26
在最外面設(shè)置常量const path = require("path");然后在entry里面設(shè)置path:path.resolve(__dirname,"dist"),
2017-09-23
改成絕對路徑了。還是報錯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"}
? ]}
}
2017-09-23
修改配置信息以后css文件并沒有編譯??偸翘崾綽undle。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"}
? ]
}
}
2017-09-16
output: {
path: ?'./dist',
filename: 'bundle.js'
}
修改為:
output: {
path: ?__dirname+'/dist',
filename: 'bundle.js'
}