-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
113 lines (105 loc) · 2.38 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
const webpack = require('webpack')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const path = require('path')
module.exports = {
mode: 'development',
entry: {
"string-mask": {
import: './src/StringMask/index.js',
filename: "string-mask.js",
library: {
name: ["BBj", "Masks", "String"],
type: 'umd',
umdNamedDefine: true
},
},
"string-mask.min": {
import: './src/StringMask/index.js',
filename: "string-mask.min.js",
library: {
name: ["BBj", "Masks", "String"],
type: 'umd',
umdNamedDefine: true
}
},
"date-mask": {
import: './src/DateMask/index.js',
filename: "date-mask.js",
library: {
name: ["BBj", "Masks", "Date"],
type: 'umd',
umdNamedDefine: true
}
},
"date-mask.min": {
import: './src/DateMask/index.js',
filename: "date-mask.min.js",
library: {
name: ["BBj", "Masks", "Date"],
type: 'umd',
umdNamedDefine: true
}
},
"number-mask": {
import: './src/NumberMask/index.js',
filename: "number-mask.js",
library: {
name: ["BBj", "Masks", "Number"],
type: 'umd',
umdNamedDefine: true
}
},
"number-mask.min": {
import: './src/NumberMask/index.js',
filename: "number-mask.min.js",
library: {
name: ["BBj", "Masks", "Number"],
type: 'umd',
umdNamedDefine: true
}
},
"bbj-masks": {
import: './src/index.js',
filename: "bbj-masks.js",
library: {
name: ["BBj", "Masks"],
type: 'umd',
umdNamedDefine: true
}
},
"bbj-masks.min": {
import: './src/index.js',
filename: "bbj-masks.min.js",
library: {
name: ["BBj", "Masks"],
type: 'umd',
umdNamedDefine: true
}
}
},
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist'),
globalObject: `(typeof self !== 'undefined' ? self : this)`
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { modules: false }]]
}
}
]
},
plugins: [
new UglifyJsPlugin({
include: /\.min\.js$/
}),
],
watchOptions: {
ignored: /node_modules/
}
}