-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
webpack.config.js
47 lines (47 loc) · 1.03 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
const webpack = require('webpack');
const path = require('path');
const packageJSON = require('./package.json');
module.exports = {
mode: 'development',
performance: {
hints: false
},
entry: {
'formio': './lib/cjs/Formio.js',
'formio.utils': './lib/cjs/utils/utils.js',
'formio.full': './lib/cjs/index.js',
'formio.form': './lib/cjs/formio.form.js',
'formio.embed': './lib/cjs/formio.embed.js'
},
output: {
library: 'Formio',
libraryTarget: 'umd',
libraryExport: 'Formio',
path: path.resolve(__dirname, './dist'),
filename: '[name].js',
environment: {
arrowFunction: false
},
},
module: {
rules: [
{
test: /\/(Formio|Embed)\.js$/,
loader: 'string-replace-loader',
options: {
search: 'FORMIO_VERSION',
replace: packageJSON.version,
}
}
]
},
plugins: [
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment$/
}),
],
resolve: {
extensions: ['.js'],
}
};