详解webpack es6 to es5支持配置
三寸蜡笔 人气:01. 安装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: '.https://img.qb5200.com/download-x/dest', filename: 'app.bundle.js', }, module: { loaders: [{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader', }] }, babel: { presets: ['es2015'] }, }
加载全部内容