UNPKG

923 BJavaScriptView Raw
1const webpack = require('webpack');
2const resolve = require('path').resolve;
3
4module.exports = {
5 entry: {
6 'g2-brush': './index.js'
7 },
8 output: {
9 filename: '[name].js',
10 library: 'Brush',
11 libraryTarget: 'umd',
12 path: resolve(__dirname, 'build/')
13 },
14 module: {
15 rules: [
16 {
17 test: /\.js$/,
18 // exclude: /(node_modules|bower_components)/,
19 use: {
20 loader: 'babel-loader',
21 options: {
22 babelrc: false,
23 plugins: [
24 'transform-remove-strict-mode'
25 ],
26 presets: [
27 [
28 'es2015', {
29 loose: true
30 // modules: false
31 }
32 ],
33 'stage-0'
34 ]
35 }
36 }
37 }
38 ]
39 },
40 plugins: [
41 new webpack.NoEmitOnErrorsPlugin(),
42 new webpack.optimize.AggressiveMergingPlugin()
43 ]
44};