-
Notifications
You must be signed in to change notification settings - Fork 320
/
webpack.config.js
69 lines (67 loc) · 2.19 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
67
68
69
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
mode: 'production',
stats: 'minimal',
entry: {
index: './src/index.ts',
accordion: './src/plugins/accordion/index.ts',
carousel: './src/plugins/carousel/index.ts',
collapse: './src/plugins/collapse/index.ts',
combobox: './src/plugins/combobox/index.ts',
'copy-markup': './src/plugins/copy-markup/index.ts',
datatable: './src/plugins/datatable/index.ts',
dropdown: './src/plugins/dropdown/index.ts',
'file-upload': './src/plugins/file-upload/index.ts',
'input-number': './src/plugins/input-number/index.ts',
'layout-splitter': './src/plugins/layout-splitter/index.ts',
overlay: './src/plugins/overlay/index.ts',
'pin-input': './src/plugins/pin-input/index.ts',
'range-slider': './src/plugins/range-slider/index.ts',
'remove-element': './src/plugins/remove-element/index.ts',
scrollspy: './src/plugins/scrollspy/index.ts',
select: './src/plugins/select/index.ts',
stepper: './src/plugins/stepper/index.ts',
'strong-password': './src/plugins/strong-password/index.ts',
tabs: './src/plugins/tabs/index.ts',
'textarea-auto-height': './src/plugins/textarea-auto-height/index.ts',
'theme-switch': './src/plugins/theme-switch/index.ts',
'toggle-count': './src/plugins/toggle-count/index.ts',
'toggle-password': './src/plugins/toggle-password/index.ts',
tooltip: './src/plugins/tooltip/index.ts',
'tree-view': './src/plugins/tree-view/index.ts',
// Helpers
'helper-apexcharts': './src/helpers/apexcharts/index.ts',
'helper-clipboard': './src/helpers/clipboard/index.ts',
},
module: {
rules: [
{ test: /\.ts?$/, enforce: 'pre', use: ['source-map-loader'] },
{ test: /\.ts?$/, use: 'ts-loader', exclude: /node_modules/ },
],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
library: { type: 'umd' },
},
externals: {
jquery: 'jQuery',
lodash: '_',
'datatable.net-dt': 'DataTable',
dropzone: 'Dropzone',
clipboard: 'ClipboardJS',
noUiSlider: 'noUiSlider',
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
},
};