1 | const webpack = require('webpack');
|
2 | const path = require('path');
|
3 |
|
4 | module.exports = {
|
5 | context: path.join(__dirname, 'src'),
|
6 | entry: [
|
7 | 'babel-polyfill',
|
8 | './main.js',
|
9 | ],
|
10 | devtool: 'source-map',
|
11 | output: {
|
12 | path: path.join(__dirname, 'www'),
|
13 | filename: 'rrdiagram.js',
|
14 | library: 'rrdiagram',
|
15 | libraryTarget: 'umd',
|
16 | umdNamedDefine: true,
|
17 | },
|
18 | module: {
|
19 | rules: [
|
20 | {
|
21 | test: /\.js$/,
|
22 | exclude: /node_modules/,
|
23 | use: [
|
24 | 'babel-loader',
|
25 | ],
|
26 | },
|
27 | ],
|
28 | },
|
29 | resolve: {
|
30 | modules: [
|
31 | path.join(__dirname, 'node_modules'),
|
32 | ],
|
33 | },
|
34 | plugins: [
|
35 | new webpack.optimize.UglifyJsPlugin({
|
36 | sourceMap: true,
|
37 | compress: {
|
38 | warnings: false,
|
39 | screw_ie8: true,
|
40 | conditionals: true,
|
41 | unused: true,
|
42 | comparisons: true,
|
43 | sequences: true,
|
44 | dead_code: true,
|
45 | evaluate: true,
|
46 | join_vars: true,
|
47 | if_return: true
|
48 | },
|
49 | output: {
|
50 | comments: false
|
51 | }
|
52 | }),
|
53 | ],
|
54 | };
|