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