-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.build.js
59 lines (51 loc) · 1.57 KB
/
webpack.config.build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const webpack = require("webpack");
/**
* import common webpack settings
*/
const commonSettings = require("./webpack.config.common.js");
/**
* @link https://github.com/webpack/docs/wiki/optimization#deduplication
* @type DedupePlugin
*/
commonSettings.plugins.push(new webpack.optimize.DedupePlugin());
/**
* @link https://github.com/webpack/docs/wiki/optimization#deduplication
* @type DedupePlugin
*/
commonSettings.plugins.push(new webpack.optimize.UglifyJsPlugin());
/**
* @link https://github.com/webpack/docs/wiki/optimization#minimize
* @type OccurenceOrderPlugin
*/
commonSettings.plugins.push(new webpack.optimize.OccurenceOrderPlugin());
/**
* https://github.com/webpack/docs/wiki/optimization#chunks
* @type LimitChunkCountPlugin
*/
commonSettings.plugins.push(new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 15 }));
/**
* @link https://github.com/webpack/docs/wiki/optimization#chunks
* @type MinChunkSizePlugin
*/
commonSettings.plugins.push(new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 10000 }));
/**
*
* @type {{root: *[]}}
*/
commonSettings.entry = {
"robe-test-server": "../src/index.js"
};
/**
* @link https://webpack.github.io/docs/configuration.html#devtool
* Choose a developer tool to enhance debugging.
* source-map - A SourceMap is emitted. See also output.sourceMapFilename.
* @type {string}
*/
commonSettings.devtool = "source-map";
commonSettings.output = {
path: commonSettings.paths.dist,
filename: "[name].min.js",
library: "robe-test-server",
libraryTarget: "umd"
};
module.exports = commonSettings;