以下是reactive的使用的使用步骤
1.配置Webpack开发环境 安装依赖
yarn add webpack webpack-dev-server webpack-cli html-webpack-plugin @babel/core babel-loader @babel/preset-env -D
2.webpack.config.js文件编写
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry:'./src/index.js',
output:{
filename:'bundle.js'
},
devtool:'source-map',
module:{
rules:[
{
test:/\.js/,use:'babel-loader',exclude:/node_modules/
}
]
},
plugins:[
new HtmlWebpackPlugin({
template:'./public/index.html'
})
]
}
3.配置.babelrc文件
{
"presets": ["@babel/preset-env"]
}
4.执行脚本配置
"scripts": {
"build:dev": "web