按照老師的寫webpack.config.js后運(yùn)行報(bào)錯(cuò)
錯(cuò)誤是
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!
有沒有大神知道這個(gè)是為啥啊
2017-07-14
var htmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
module.exports = {
? ? entry: './src/script/main.js',
? ? output:{
? ? ? ? ?path:path.resolve(__dirname,'./dist/js'),
? ? ? ? ?filename:'[name].js'
}
}
2018-11-04
我這個(gè)問題前面跟你的錯(cuò)誤一樣,后面就不一樣了。不知道怎么改。
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
?- configuration.module.rules[3].use should be one of these:
? ?non-empty string | function | object { ident?, loader?, options?, query? } | function | [non-empty string | function | object { ident?, loader?, options?, query? }]
? ?-> Modifiers applied to the module when rule is matched
? ?Details:
? ? * configuration.module.rules[3].use should be a string.
? ? * configuration.module.rules[3].use should be an instance of function
? ? * configuration.module.rules[3].use should be an object.
? ? * configuration.module.rules[3].use should be an instance of function
? ? * configuration.module.rules[3].use[0] should be a string.
? ? * configuration.module.rules[3].use[0] should be an instance of function
? ? * configuration.module.rules[3].use[0] has an unknown property 'option'. These properties are valid:
? ? ? object { ident?, loader?, options?, query? }
2018-04-03
2017-07-30
webpack版本的問題,可以改成path: __dirname + '/dist/js',
2017-07-16
直接
path: path.resolve(__dirname, 'dist'),
不要./dist
2017-07-16
少了個(gè)? var path = require('path') 的引入
2017-07-14
./dist/js 把前面一點(diǎn)去了也可以?/dist/js?
2017-07-14
也可能你沒有建dist這個(gè)文件夾
2017-07-14
output:{
????path:路徑錯(cuò)誤
}
不知道是不是,把代碼復(fù)制出來看看,比較容易看那里錯(cuò)了