forked from awslabs/diagram-maker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.js
More file actions
44 lines (42 loc) · 1.23 KB
/
Copy pathwebpack.prod.js
File metadata and controls
44 lines (42 loc) · 1.23 KB
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
const baseConfig = require('./webpack.common.js');
const path = require('path');
const merge = require('webpack-merge').merge;
const DeclarationBundlePlugin = require('./DeclarationBundlePlugin.js');
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
// TODO: We can add a threshold on the asset size in our build setp here.
module.exports = merge(baseConfig, {
mode: 'production',
devtool: 'source-map',
bail: true,
output: {
filename: 'diagramMaker.js',
path: path.resolve(__dirname, 'dist'),
library: 'diagramMaker',
libraryTarget: 'umd',
umdNamedDefine: true
},
externals: {
dagre: 'dagre'
},
optimization: {
minimizer: [
new OptimizeCSSAssetsPlugin({})
]
},
plugins: [
// Extract all CSS
new MiniCssExtractPlugin({
filename: 'diagramMaker.css'
}),
new DeclarationBundlePlugin({
name: 'diagramMaker.d.ts',
inlinedLibraries: ['redux', 'symbol-observable']
})
],
stats: {
// This is because of a limitation in ts-loader
// https://github.com/TypeStrong/ts-loader#transpileonly-boolean-defaultfalse
warningsFilter: /export .* was not found in/
}
});