老师, 使用babel 如何兼容IE9+呢
来源:3-12 使用 Babel 处理 ES6 语法(2)
行走在二进制世界
2020-12-16
写回答
2回答
-
行走在二进制世界
提问者
2020-12-17
const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { mode: 'development', entry: { main: './src/index.js' }, devServer: { port: 9000, }, module: { rules: [{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader', }] }, plugins: [ new HtmlWebpackPlugin({ template: 'src/index.html' }) ], output: { filename: '[name].js', path: path.resolve(__dirname, 'dist') } }
"scripts": { "dev": "webpack serve" }, "author": "", "license": "ISC", "dependencies": { "@babel/core": "^7.12.10", "@babel/preset-env": "^7.12.11", "babel-loader": "^8.2.2" }, "devDependencies": { "html-webpack-plugin": "^4.5.0", "webpack": "^5.10.3", "webpack-cli": "^4.2.0", "webpack-dev-server": "^3.11.0" }
{ "presets": ["@babel/preset-env"] }
00 -
Dell
2020-12-17
这个你只能通过polyfill 来试试了,你想让什么兼容ie9?
022020-12-17
相似问题