详解webpack es6 to es5支持配置
1. 安装webpack
npm install webpack --save-dev
2. 安装babel 实现 ES6 到 ES5
npm install --save-dev babel-core babel-preset-es2015
3.安装 babel-loader
npm install --save-dev babel-loader
webpack.config.js完整配置
module.exports = { entry: './src/js/app.js', output: { path: './dest', filename: 'app.bundle.js', }, module: { loaders: [{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader', }] }, babel: { presets: ['es2015'] }, }
相关推荐
PANH 2020-06-07
不知道该写啥QAQ 2020-11-12
webfullStack 2020-11-09
Yvettre 2020-09-15
想做大牛的蜗牛 2020-10-30
gloria0 2020-10-26
gaojie0 2020-09-11
SelinaChan 2020-08-14
不知道该写啥QAQ 2020-08-09
gloria0 2020-08-09
不知道该写啥QAQ 2020-08-02
hline 2020-07-29
SelinaChan 2020-07-28
wangdianyong 2020-07-23
webpackvuees 2020-07-23
yqoxygen 2020-07-20
不知道该写啥QAQ 2020-07-18
waterv 2020-07-18