webpack入门的配置遇到的问题

来源:互联网 发布:wow7.0优化 编辑:程序博客网 时间:2024/06/11 01:39

初阶段学习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’
}
}
“`