This repository has been archived by the owner on Dec 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
webpack.config.js
66 lines (63 loc) · 3.94 KB
/
webpack.config.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
60
61
62
63
64
65
66
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
'online-map-item': './src/online-map-item/online-map-extension.ts',
'dashboard-panel': './src/dashboard-panel/dashboard-panel.ts',
'funnel-d3-item': './src/funnel-d3-item/funnel-d3-extension.ts',
'parameter-item': './src/parameter-item/parameter-item-extension.ts',
'webpage-item': './src/webpage-item/webpage-extension.ts',
'simple-table-item': './src/simple-table/simple-table-extension.js',
'polar-chart-item': './src/polar-chart-item/polar-chart-extension.ts',
},
output: {
libraryTarget: 'umd',
path: path.resolve('./'),
filename: "dist/[name].js"
},
externals: {
'jquery': { root: '$', commonjs2: 'jquery', commonjs: 'jquery', amd: 'jquery' },
'knockout': { root: 'ko', commonjs2: 'knockout', commonjs: 'knockout', amd: 'knockout' },
'd3-funnel': { root: 'D3Funnel', commonjs2: 'd3-funnel', commonjs: 'd3-funnel', amd: 'd3-funnel' },
'devextreme/ui/map': { root: ['DevExpress', 'ui', 'dxMap'], commonjs2: 'devextreme/ui/map', commonjs: 'devextreme/ui/map', amd: 'devextreme/ui/map' },
'devextreme/viz/polar_chart': { root: ['DevExpress', 'viz', 'dxPolarChart'], commonjs2: 'devextreme/viz/polar_chart', commonjs: 'devextreme/viz/polar_chart', amd: 'devextreme/viz/polar_chart' },
'devextreme/ui/button': { root: ['DevExpress', 'ui', 'dxButton'], commonjs2: 'devextreme/ui/button', commonjs: 'devextreme/ui/button', amd: 'devextreme/ui/button' },
'devextreme/core/devices': { root: ['DevExpress', 'devices'], commonjs2: 'devextreme/core/devices', commonjs: 'devextreme/core/devices', amd: 'devextreme/core/devices' },
'devexpress-dashboard': { root: ['DevExpress', 'Dashboard'], commonjs2: 'devexpress-dashboard', commonjs: 'devexpress-dashboard', amd: 'devexpress-dashboard' },
'devexpress-dashboard/common': { root: ['DevExpress', 'Dashboard'], commonjs2: 'devexpress-dashboard/common', commonjs: 'devexpress-dashboard/common', amd: 'devexpress-dashboard/common' },
'devexpress-dashboard/model': { root: ['DevExpress', 'Dashboard', 'Model'], commonjs2: 'devexpress-dashboard/model', commonjs: 'devexpress-dashboard/model', amd: 'devexpress-dashboard/model' },
'devexpress-dashboard/data': { root: ['DevExpress', 'Dashboard', 'Data'], commonjs2: 'devexpress-dashboard/data', commonjs: 'devexpress-dashboard/data', amd: 'devexpress-dashboard/data' },
'devexpress-dashboard/designer': { root: ['DevExpress', 'Dashboard', 'Designer'],commonjs2: 'devexpress-dashboard/designer', commonjs: 'devexpress-dashboard/designer', amd: 'devexpress-dashboard/designer' },
'devexpress-dashboard/model/index.metadata': { root: ['DevExpress', 'Dashboard', 'Metadata'], commonjs2: 'devexpress-dashboard/model/index.metadata', commonjs: 'devexpress-dashboard/model/index.metadata', amd: 'devexpress-dashboard/model/index.metadata' },
},
mode: 'production',
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
output: {
comments: '/^\/*!/',
beautify: true
},
mangle: false,
compress: false
}
})
]
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ }
]
},
plugins: [
new CopyWebpackPlugin([
{ from: '**/*.html', to: __dirname + '/dist/', context: __dirname + '/src', flatten: true },
{ from: '**/*.css', to: __dirname + '/dist/', context: __dirname + '/src', flatten: true }
], { force: true })
]
};