js笔记

1 configuring Webpack with Babel in 26 lines
[http://jamesknelson.com/webpack-made-simple-build-es6-less-with-autorefresh-in-26-lines/]

var path = require('path');
var webpack = require('webpack');

module.exports = {
  entry: [
    'babel-polyfill',
    './src/main'
  ],
  output: {
      publicPath: '/',
      filename: 'main.js'
  },
  devtool: 'source-map',
  module: {
    loaders: [
      {
        test: /.js$/,
        include: path.join(__dirname, 'src'),
        loader: 'babel-loader',
        query: {
          presets: ["es2015"],  
        }
      }
    ]
  },
  debug: true
};
原文地址:https://www.cnblogs.com/zh33gl/p/11016204.html