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
};
posted @ 2019-06-13 14:06  风的线条昵称已被使用  阅读(75)  评论(0编辑  收藏  举报