-
-
Notifications
You must be signed in to change notification settings - Fork 129
/
webpack.config.js
executable file
·47 lines (44 loc) · 1.18 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 LodashModuleReplacementPlugin = require("lodash-webpack-plugin");
const { join } = require("path");
const MINIFY = process.env.MINIFY === "YES";
const rules = [
{
test: /\.ts$/,
loader: "ts-loader",
include: join(__dirname, "src"),
},
{
test: /\.json$/,
loader: "json-loader",
},
];
module.exports = {
mode: MINIFY ? "production" : "development",
devtool: "source-map",
entry: {
MobxReactForm: "./src/index",
MobxReactFormComposer: "./src/composer",
MobxReactFormValidatorVJF: "./src/validators/VJF",
MobxReactFormValidatorDVR: "./src/validators/DVR",
MobxReactFormValidatorSVK: "./src/validators/SVK",
MobxReactFormValidatorYUP: "./src/validators/YUP",
MobxReactFormValidatorJOI: "./src/validators/JOI",
MobxReactFormValidatorZOD: "./src/validators/ZOD",
},
output: {
path: join(__dirname, "umd"),
filename: MINIFY ? "[name].umd.min.js" : "[name].umd.js",
library: "[name]",
libraryTarget: "umd",
},
resolve: {
modules: ["node_modules"],
extensions: [".ts", ".json"],
},
externals: {
mobx: "mobx",
lodash: "_",
},
module: { rules },
plugins: [new LodashModuleReplacementPlugin()],
};