Browse Source

ci: add babel

master
wally 4 years ago
parent
commit
2360083607
  1. 3
      package.json
  2. 16
      webpack.config.js

3
package.json

@ -5,6 +5,9 @@
"main": "webpack.config.js",
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.3.2",
"webpack": "^5.54.0",
"webpack-cli": "^4.8.0",

16
webpack.config.js

@ -12,6 +12,22 @@ module.exports = {
port: 6001,
hot: true
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
plugins: [
new HtmlWebpackPlugin({
title: '游戏窗体模板',

Loading…
Cancel
Save