npm i babel-loader babel-core babel-preset-es2015 babel-plugin-transform-runtime -D
node_modules\.bin\webpack-dev-server 使用webpack-dev-server 要用反斜杠
webpack.config.js配置文件
const path = require(‘path‘);
module.exports = {
entry:‘./src/index.js‘,
output:{
filename:‘bundle.js‘,
path:path.resolve(__dirname,‘dist‘)
},
devServer:{
contentBase:‘./dist‘
}
}
原文地址:https://www.cnblogs.com/allentsl/p/9309597.html
时间: 2024-10-10 04:02:50