forked from TLive/Open-Web-Analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
83 lines (69 loc) · 2.51 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
const path = require('path');
const dist_path = '/modules/base/dist';
const src_path = __dirname + '/modules/base/src';
const terser = require('terser');
const WebpackConcatPlugin = require('webpack-concat-files-plugin');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: {
'owa.tracker.js': [
path.resolve(__dirname, src_path + '/tracker/tracker-dom.js')
],
},
output: {
path: __dirname + dist_path, // Output to dist directory
chunkFilename: '[name].js',
iife: false,
filename: "[name]"
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin({
extractComments: false,
})],
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'owa.vendors',
chunks: 'all'
}
}
}
},
plugins: [
new WebpackConcatPlugin({
bundles: [
{
dest: __dirname + dist_path + '/owa.reporting-combined-min.js',
src: [
src_path + '/reporting/v1/includes/jquery/jquery-1.6.4.min.js',
src_path + '/reporting/v1/includes/jquery/jquery.sprintf.js',
src_path + '/reporting/v1/includes/jquery/jquery-ui-1.8.12.custom.min.js',
src_path + '/reporting/v1/includes/jquery/jquery.ui.selectmenu.js',
src_path + '/reporting/v1/includes/jquery/chosen.jquery.js',
src_path + '/reporting/v1/includes/jquery/jquery.sparkline.min.js',
src_path + '/reporting/v1/includes/jquery/jquery.jqGrid.min.js',
src_path + '/reporting/v1/includes/jquery/flot_v0.7/jquery.flot.min.js',
src_path + '/reporting/v1/includes/jquery/flot_v0.7/jquery.flot.resize.min.js',
src_path + '/reporting/v1/includes/jquery/flot_v0.7/jquery.flot.pie.min.js',
src_path + '/reporting/v1/includes/jquery/jQote2/jquery.jqote2.min.js',
src_path + '/reporting/v1/owa.js',
src_path + '/reporting/v1/owa.report.js',
src_path + '/reporting/v1/owa.resultSetExplorer.js',
src_path + '/reporting/v1/owa.sparkline.js',
src_path + '/reporting/v1/owa.areachart.js',
src_path + '/reporting/v1/owa.piechart.js',
src_path + '/reporting/v1/owa.kpibox.js',
],
transforms: {
after: async (code) => {
const minifiedCode = await terser.minify(code);
return minifiedCode.code;
},
},
},
],
}),
],
};