
结果报错,没有contentBase这个属性,已经被弃用了。
新的配置方式:
js
const path = require('path');
module.exports = {
//...
devServer: {
static: {
directory: path.join(__dirname, 'public'),
},
compress: true,
port: 9000,
},
};