带有babel的webpack.config.js的示例
示例
依存关系
npm i -D webpack babel-loader
webpack.config.js
const path = require('path'); module.exports = { entry: { app: ['babel-polyfill', './src/'], }, output: { path: __dirname, filename: './dist/[name].js', }, resolve: { extensions: ['', '.js'], }, module: { loaders: [{ test: /\.js$/, loaders: ['babel-loader'], include: path.resolve(__dirname, 'src') }], } };