-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
73 lines (69 loc) · 1.7 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
// noinspection WebpackConfigHighlighting
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const webpack = require("webpack");
// noinspection JSUnresolvedReference
let bannerPlugin = new webpack.BannerPlugin({
banner: `/*!
* OTP-designer-jquery v2.3.1
* (c) HichemTech
* Released under the MIT License.
* Github: github.com/HichemTab-tech/OTP-designer-jquery
*/
`,
raw: true,
});
let module_ = {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
],
};
module.exports = [
{
mode: 'production',
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'otpdesigner.js',
library: 'OTP-designer-jquery',
libraryTarget: 'umd', // or 'umd2'
globalObject: 'this',
},
optimization: {
minimize: false,
},
plugins: [
bannerPlugin
],
module: module_
},
{
mode: 'production',
entry: './index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'otpdesigner.min.js',
library: 'OTP-designer-jquery',
libraryTarget: 'umd', // or 'umd2'
globalObject: 'this',
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
}),
],
},
plugins: [
new TerserPlugin({
extractComments: false,
}),
bannerPlugin
],
module: module_
},
];