初阶段学习webpack配置output路径问题
module.exports = {
entry: './src/app.js',
output: {
path: './bin',
filename: 'app.bundle.js'
}
}```
出现报错:*Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output.path: The provided value "./bin" is not an absolute path!*
**正确的解决方法**
输出路径output中path加入根路径
module.exports = {
entry: ‘./src/app.js’,
output: {
path: __dirname + ‘/bin’,
filename: ‘app.bundle.js’
}
}
“`