@elliemae/pui-cli 8.60.2 → 8.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/webpack/helpers.js +26 -22
- package/dist/cjs/webpack/prop-types-shim.js +86 -0
- package/dist/cjs/webpack/webpack.dev.babel.js +9 -1
- package/dist/cjs/webpack/webpack.prod.babel.js +22 -1
- package/dist/esm/webpack/helpers.js +26 -22
- package/dist/esm/webpack/prop-types-shim.js +66 -0
- package/dist/esm/webpack/webpack.dev.babel.js +9 -1
- package/dist/esm/webpack/webpack.prod.babel.js +21 -1
- package/dist/types/lib/webpack/helpers.d.ts +12 -1
- package/dist/types/lib/webpack/prop-types-shim.d.ts +356 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -15
- package/build/docs/404.html +0 -16
- package/build/docs/api/functions/loadRoutes/index.html +0 -22
- package/build/docs/api/index.html +0 -22
- package/build/docs/api/type-aliases/LIB_NAME/index.html +0 -17
- package/build/docs/api/variables/babelConfig/index.html +0 -40
- package/build/docs/api/variables/commitlintConfig/index.html +0 -20
- package/build/docs/api/variables/eslintBaseConfig/index.html +0 -130
- package/build/docs/api/variables/eslintConfig/index.html +0 -178
- package/build/docs/api/variables/jestConfig/index.html +0 -98
- package/build/docs/api/variables/jestNodeConfig/index.html +0 -98
- package/build/docs/api/variables/lintStagedConfig/index.html +0 -24
- package/build/docs/api/variables/prettierConfig/index.html +0 -30
- package/build/docs/api/variables/stylelintConfig/index.html +0 -30
- package/build/docs/api/variables/vitestConfig/index.html +0 -17
- package/build/docs/assets/css/styles.690bd141.css +0 -1
- package/build/docs/assets/js/04ee7372.2e1e1e1d.js +0 -1
- package/build/docs/assets/js/0551d4dd.58dce19e.js +0 -1
- package/build/docs/assets/js/1024.0ca269c1.js +0 -1
- package/build/docs/assets/js/1146.7ff9d7f5.js +0 -1
- package/build/docs/assets/js/1236.24991ad9.js +0 -1
- package/build/docs/assets/js/1288.9c173a20.js +0 -1
- package/build/docs/assets/js/1416.c604f5e7.js +0 -1
- package/build/docs/assets/js/1597.17d2bd76.js +0 -1
- package/build/docs/assets/js/16b7bc88.2cc43381.js +0 -1
- package/build/docs/assets/js/17896441.25e17bfc.js +0 -1
- package/build/docs/assets/js/1b9df811.248b2d00.js +0 -1
- package/build/docs/assets/js/214.e932bc50.js +0 -1
- package/build/docs/assets/js/2374.ae355d5a.js +0 -1
- package/build/docs/assets/js/2489.1ace319a.js +0 -1
- package/build/docs/assets/js/257.da6ab919.js +0 -1
- package/build/docs/assets/js/2665.3d3ed8e7.js +0 -1
- package/build/docs/assets/js/3157.499b7ccc.js +0 -1
- package/build/docs/assets/js/3459.1cf3b2a0.js +0 -1
- package/build/docs/assets/js/3508.f2459147.js +0 -1
- package/build/docs/assets/js/3577.bf712d7a.js +0 -1
- package/build/docs/assets/js/3637.2fd79cb3.js +0 -1
- package/build/docs/assets/js/37d86055.00427a30.js +0 -1
- package/build/docs/assets/js/3842.bba4c6ae.js +0 -1
- package/build/docs/assets/js/4567.68666b1a.js +0 -1
- package/build/docs/assets/js/4807.c70072c2.js +0 -2
- package/build/docs/assets/js/4807.c70072c2.js.LICENSE.txt +0 -1
- package/build/docs/assets/js/5292.6c0adb74.js +0 -1
- package/build/docs/assets/js/531.b3c0f751.js +0 -1
- package/build/docs/assets/js/5340.8d229cb1.js +0 -1
- package/build/docs/assets/js/5495.fc6702af.js +0 -1
- package/build/docs/assets/js/5514.9fd8c017.js +0 -1
- package/build/docs/assets/js/587.3e897148.js +0 -1
- package/build/docs/assets/js/5961.53c06284.js +0 -1
- package/build/docs/assets/js/5d5f1db0.3d288dfe.js +0 -1
- package/build/docs/assets/js/5e8c322a.63d6d806.js +0 -1
- package/build/docs/assets/js/5e95c892.0d2e631f.js +0 -1
- package/build/docs/assets/js/5fb3c522.1592c73f.js +0 -1
- package/build/docs/assets/js/638.f59bb1de.js +0 -2
- package/build/docs/assets/js/638.f59bb1de.js.LICENSE.txt +0 -9
- package/build/docs/assets/js/6769.4deb61f5.js +0 -1
- package/build/docs/assets/js/6bd11e52.4b9c45b0.js +0 -1
- package/build/docs/assets/js/6e96545e.533bc68f.js +0 -1
- package/build/docs/assets/js/7002.315eaa08.js +0 -1
- package/build/docs/assets/js/71f6d02b.87cb2383.js +0 -1
- package/build/docs/assets/js/7217.9270512e.js +0 -1
- package/build/docs/assets/js/7307.15fc501e.js +0 -1
- package/build/docs/assets/js/7431.89a82fd9.js +0 -1
- package/build/docs/assets/js/777.db9eb7f1.js +0 -1
- package/build/docs/assets/js/7827.3bf58028.js +0 -1
- package/build/docs/assets/js/80e87108.57f84690.js +0 -1
- package/build/docs/assets/js/8177.0f879494.js +0 -1
- package/build/docs/assets/js/8218.4b3271b4.js +0 -1
- package/build/docs/assets/js/8410.4caf8372.js +0 -1
- package/build/docs/assets/js/8751.f6d57117.js +0 -1
- package/build/docs/assets/js/8775.854a763b.js +0 -1
- package/build/docs/assets/js/9111.e4f9e857.js +0 -1
- package/build/docs/assets/js/9400.feb1292f.js +0 -1
- package/build/docs/assets/js/9407.5adfbff6.js +0 -1
- package/build/docs/assets/js/a7bd4aaa.50af694c.js +0 -1
- package/build/docs/assets/js/a94703ab.681fb870.js +0 -1
- package/build/docs/assets/js/aba21aa0.3bbcf0cc.js +0 -1
- package/build/docs/assets/js/b8ac1d98.c1c3b146.js +0 -1
- package/build/docs/assets/js/bde5209a.bbb8d0f5.js +0 -1
- package/build/docs/assets/js/c377a04b.21ea0a0a.js +0 -1
- package/build/docs/assets/js/common.f683c0f9.js +0 -1
- package/build/docs/assets/js/e5f79924.2efdfe47.js +0 -1
- package/build/docs/assets/js/f736c962.6265de57.js +0 -1
- package/build/docs/assets/js/main.8c66192c.js +0 -2
- package/build/docs/assets/js/main.8c66192c.js.LICENSE.txt +0 -51
- package/build/docs/assets/js/runtime~main.da6a4745.js +0 -1
- package/build/docs/img/favicon.ico +0 -0
- package/build/docs/img/logo.jpeg +0 -0
- package/build/docs/img/logo.svg +0 -22
- package/build/docs/img/readme.md +0 -1
- package/build/docs/index.html +0 -175
- package/build/docs/readme.md +0 -1
- package/build/docs/sitemap.xml +0 -1
- package/build/docs/ssl-certificate-setup/index.html +0 -284
- package/build/docs/usage-guide/index.html +0 -385
|
@@ -91,28 +91,32 @@ const mapToFolder = (dependencies, folder) => dependencies.reduce(
|
|
|
91
91
|
);
|
|
92
92
|
const getAlias = () => {
|
|
93
93
|
const monorepoRoot = (0, import_utils.findMonoRepoRoot)(process.cwd()) || "";
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
94
|
+
const folder = import_node_path.default.join(monorepoRoot, "./node_modules");
|
|
95
|
+
return {
|
|
96
|
+
...mapToFolder(
|
|
97
|
+
[
|
|
98
|
+
"@babel/runtime",
|
|
99
|
+
"react",
|
|
100
|
+
"react-dom",
|
|
101
|
+
"react-redux",
|
|
102
|
+
"redux",
|
|
103
|
+
"redux-saga",
|
|
104
|
+
"moment",
|
|
105
|
+
"lodash",
|
|
106
|
+
"styled-components",
|
|
107
|
+
"immer",
|
|
108
|
+
"react-dates",
|
|
109
|
+
"react-select",
|
|
110
|
+
"react-spring",
|
|
111
|
+
"react-transition-group",
|
|
112
|
+
"@elliemae/pui-cli",
|
|
113
|
+
"@elliemae/pui-app-sdk$",
|
|
114
|
+
"@elliemae/pui-theme$"
|
|
115
|
+
],
|
|
116
|
+
folder
|
|
117
|
+
),
|
|
118
|
+
"lodash-es": import_node_path.default.resolve(`${folder}/lodash`)
|
|
119
|
+
};
|
|
116
120
|
};
|
|
117
121
|
const getLibraryAlias = (name, alias) => {
|
|
118
122
|
const monorepoRoot = (0, import_utils.findMonoRepoRoot)(process.cwd()) || "";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var prop_types_shim_exports = {};
|
|
20
|
+
__export(prop_types_shim_exports, {
|
|
21
|
+
any: () => any,
|
|
22
|
+
array: () => array,
|
|
23
|
+
arrayOf: () => arrayOf,
|
|
24
|
+
bigint: () => bigint,
|
|
25
|
+
bool: () => bool,
|
|
26
|
+
checkPropTypes: () => checkPropTypes,
|
|
27
|
+
default: () => prop_types_shim_default,
|
|
28
|
+
element: () => element,
|
|
29
|
+
elementType: () => elementType,
|
|
30
|
+
exact: () => exact,
|
|
31
|
+
func: () => func,
|
|
32
|
+
instanceOf: () => instanceOf,
|
|
33
|
+
node: () => node,
|
|
34
|
+
number: () => number,
|
|
35
|
+
object: () => object,
|
|
36
|
+
objectOf: () => objectOf,
|
|
37
|
+
oneOf: () => oneOf,
|
|
38
|
+
oneOfType: () => oneOfType,
|
|
39
|
+
resetWarningCache: () => resetWarningCache,
|
|
40
|
+
shape: () => shape,
|
|
41
|
+
string: () => string,
|
|
42
|
+
symbol: () => symbol
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(prop_types_shim_exports);
|
|
45
|
+
const shim = function noop() {
|
|
46
|
+
return shim;
|
|
47
|
+
};
|
|
48
|
+
shim.isRequired = shim;
|
|
49
|
+
const createPropTypes = () => {
|
|
50
|
+
const handler = {
|
|
51
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
52
|
+
get(_target, prop) {
|
|
53
|
+
if (prop === "__esModule") return true;
|
|
54
|
+
if (prop === "default") return pt;
|
|
55
|
+
return shim;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const pt = typeof Proxy !== "undefined" ? new Proxy(shim, handler) : shim;
|
|
59
|
+
pt.checkPropTypes = shim;
|
|
60
|
+
pt.resetWarningCache = shim;
|
|
61
|
+
pt.PropTypes = pt;
|
|
62
|
+
return pt;
|
|
63
|
+
};
|
|
64
|
+
const propTypes = createPropTypes();
|
|
65
|
+
var prop_types_shim_default = propTypes;
|
|
66
|
+
const array = shim;
|
|
67
|
+
const bigint = shim;
|
|
68
|
+
const bool = shim;
|
|
69
|
+
const func = shim;
|
|
70
|
+
const number = shim;
|
|
71
|
+
const object = shim;
|
|
72
|
+
const string = shim;
|
|
73
|
+
const symbol = shim;
|
|
74
|
+
const any = shim;
|
|
75
|
+
const arrayOf = shim;
|
|
76
|
+
const element = shim;
|
|
77
|
+
const elementType = shim;
|
|
78
|
+
const instanceOf = shim;
|
|
79
|
+
const node = shim;
|
|
80
|
+
const objectOf = shim;
|
|
81
|
+
const oneOf = shim;
|
|
82
|
+
const oneOfType = shim;
|
|
83
|
+
const shape = shim;
|
|
84
|
+
const exact = shim;
|
|
85
|
+
const checkPropTypes = shim;
|
|
86
|
+
const resetWarningCache = shim;
|
|
@@ -93,7 +93,15 @@ const devConfig = {
|
|
|
93
93
|
emui: {
|
|
94
94
|
name: "emui",
|
|
95
95
|
test: /[\\/]node_modules[\\/](@elliemae)[\\/]/,
|
|
96
|
-
priority: 1
|
|
96
|
+
priority: process.env.SPLIT_FRAMEWORK_CHUNK === "true" ? 3 : 1
|
|
97
|
+
},
|
|
98
|
+
...process.env.SPLIT_FRAMEWORK_CHUNK === "true" && {
|
|
99
|
+
framework: {
|
|
100
|
+
name: "framework",
|
|
101
|
+
test: /[\\/]node_modules[\\/](react|react-dom|scheduler|react-router|react-router-dom|history|react-is)[\\/]/,
|
|
102
|
+
priority: 2,
|
|
103
|
+
enforce: true
|
|
104
|
+
}
|
|
97
105
|
},
|
|
98
106
|
vendors: {
|
|
99
107
|
name: "vendors",
|
|
@@ -32,6 +32,7 @@ __export(webpack_prod_babel_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(webpack_prod_babel_exports);
|
|
34
34
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
35
|
+
var import_node_url = require("node:url");
|
|
35
36
|
var import_html_webpack_plugin = __toESM(require("html-webpack-plugin"), 1);
|
|
36
37
|
var import_workbox_webpack_plugin = require("workbox-webpack-plugin");
|
|
37
38
|
var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"), 1);
|
|
@@ -40,6 +41,9 @@ var import_esbuild_loader = require("esbuild-loader");
|
|
|
40
41
|
var import_browserslist_to_esbuild = __toESM(require("browserslist-to-esbuild"), 1);
|
|
41
42
|
var import_webpack_base_babel = require("./webpack.base.babel.js");
|
|
42
43
|
var import_helpers = require("./helpers.js");
|
|
44
|
+
const import_meta = {};
|
|
45
|
+
const __dirname = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
46
|
+
const propTypesShim = import_node_path.default.resolve(__dirname, "prop-types-shim.js");
|
|
43
47
|
const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
44
48
|
const { buildPath } = (0, import_helpers.getPaths)(latestVersion);
|
|
45
49
|
return {
|
|
@@ -67,13 +71,25 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
67
71
|
})
|
|
68
72
|
],
|
|
69
73
|
runtimeChunk: true,
|
|
74
|
+
// Three-tier chunking strategy (opt-in via SPLIT_FRAMEWORK_CHUNK=true):
|
|
75
|
+
// emui – @elliemae packages (design system, SDK)
|
|
76
|
+
// framework – React core + router (changes rarely, great cache hit)
|
|
77
|
+
// vendors – everything else from node_modules
|
|
70
78
|
splitChunks: {
|
|
71
79
|
chunks: "all",
|
|
72
80
|
cacheGroups: {
|
|
73
81
|
emui: {
|
|
74
82
|
name: "emui",
|
|
75
83
|
test: /[\\/]node_modules[\\/](@elliemae)[\\/]/,
|
|
76
|
-
priority: 1
|
|
84
|
+
priority: process.env.SPLIT_FRAMEWORK_CHUNK === "true" ? 3 : 1
|
|
85
|
+
},
|
|
86
|
+
...process.env.SPLIT_FRAMEWORK_CHUNK === "true" && {
|
|
87
|
+
framework: {
|
|
88
|
+
name: "framework",
|
|
89
|
+
test: /[\\/]node_modules[\\/](react|react-dom|scheduler|react-router|react-router-dom|history|react-is)[\\/]/,
|
|
90
|
+
priority: 2,
|
|
91
|
+
enforce: true
|
|
92
|
+
}
|
|
77
93
|
},
|
|
78
94
|
vendors: {
|
|
79
95
|
name: "vendors",
|
|
@@ -101,6 +117,11 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
101
117
|
})
|
|
102
118
|
],
|
|
103
119
|
devtool: "source-map",
|
|
120
|
+
resolve: {
|
|
121
|
+
alias: {
|
|
122
|
+
"prop-types": propTypesShim
|
|
123
|
+
}
|
|
124
|
+
},
|
|
104
125
|
performance: {
|
|
105
126
|
assetFilter: (assetFilename) => !/(\.map$)|(^(main\.|favicon\.))/.test(assetFilename)
|
|
106
127
|
}
|
|
@@ -41,28 +41,32 @@ const mapToFolder = (dependencies, folder) => dependencies.reduce(
|
|
|
41
41
|
);
|
|
42
42
|
const getAlias = () => {
|
|
43
43
|
const monorepoRoot = findMonoRepoRoot(process.cwd()) || "";
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
44
|
+
const folder = path.join(monorepoRoot, "./node_modules");
|
|
45
|
+
return {
|
|
46
|
+
...mapToFolder(
|
|
47
|
+
[
|
|
48
|
+
"@babel/runtime",
|
|
49
|
+
"react",
|
|
50
|
+
"react-dom",
|
|
51
|
+
"react-redux",
|
|
52
|
+
"redux",
|
|
53
|
+
"redux-saga",
|
|
54
|
+
"moment",
|
|
55
|
+
"lodash",
|
|
56
|
+
"styled-components",
|
|
57
|
+
"immer",
|
|
58
|
+
"react-dates",
|
|
59
|
+
"react-select",
|
|
60
|
+
"react-spring",
|
|
61
|
+
"react-transition-group",
|
|
62
|
+
"@elliemae/pui-cli",
|
|
63
|
+
"@elliemae/pui-app-sdk$",
|
|
64
|
+
"@elliemae/pui-theme$"
|
|
65
|
+
],
|
|
66
|
+
folder
|
|
67
|
+
),
|
|
68
|
+
"lodash-es": path.resolve(`${folder}/lodash`)
|
|
69
|
+
};
|
|
66
70
|
};
|
|
67
71
|
const getLibraryAlias = (name, alias) => {
|
|
68
72
|
const monorepoRoot = findMonoRepoRoot(process.cwd()) || "";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const shim = function noop() {
|
|
2
|
+
return shim;
|
|
3
|
+
};
|
|
4
|
+
shim.isRequired = shim;
|
|
5
|
+
const createPropTypes = () => {
|
|
6
|
+
const handler = {
|
|
7
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
8
|
+
get(_target, prop) {
|
|
9
|
+
if (prop === "__esModule") return true;
|
|
10
|
+
if (prop === "default") return pt;
|
|
11
|
+
return shim;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const pt = typeof Proxy !== "undefined" ? new Proxy(shim, handler) : shim;
|
|
15
|
+
pt.checkPropTypes = shim;
|
|
16
|
+
pt.resetWarningCache = shim;
|
|
17
|
+
pt.PropTypes = pt;
|
|
18
|
+
return pt;
|
|
19
|
+
};
|
|
20
|
+
const propTypes = createPropTypes();
|
|
21
|
+
var prop_types_shim_default = propTypes;
|
|
22
|
+
const array = shim;
|
|
23
|
+
const bigint = shim;
|
|
24
|
+
const bool = shim;
|
|
25
|
+
const func = shim;
|
|
26
|
+
const number = shim;
|
|
27
|
+
const object = shim;
|
|
28
|
+
const string = shim;
|
|
29
|
+
const symbol = shim;
|
|
30
|
+
const any = shim;
|
|
31
|
+
const arrayOf = shim;
|
|
32
|
+
const element = shim;
|
|
33
|
+
const elementType = shim;
|
|
34
|
+
const instanceOf = shim;
|
|
35
|
+
const node = shim;
|
|
36
|
+
const objectOf = shim;
|
|
37
|
+
const oneOf = shim;
|
|
38
|
+
const oneOfType = shim;
|
|
39
|
+
const shape = shim;
|
|
40
|
+
const exact = shim;
|
|
41
|
+
const checkPropTypes = shim;
|
|
42
|
+
const resetWarningCache = shim;
|
|
43
|
+
export {
|
|
44
|
+
any,
|
|
45
|
+
array,
|
|
46
|
+
arrayOf,
|
|
47
|
+
bigint,
|
|
48
|
+
bool,
|
|
49
|
+
checkPropTypes,
|
|
50
|
+
prop_types_shim_default as default,
|
|
51
|
+
element,
|
|
52
|
+
elementType,
|
|
53
|
+
exact,
|
|
54
|
+
func,
|
|
55
|
+
instanceOf,
|
|
56
|
+
node,
|
|
57
|
+
number,
|
|
58
|
+
object,
|
|
59
|
+
objectOf,
|
|
60
|
+
oneOf,
|
|
61
|
+
oneOfType,
|
|
62
|
+
resetWarningCache,
|
|
63
|
+
shape,
|
|
64
|
+
string,
|
|
65
|
+
symbol
|
|
66
|
+
};
|
|
@@ -63,7 +63,15 @@ const devConfig = {
|
|
|
63
63
|
emui: {
|
|
64
64
|
name: "emui",
|
|
65
65
|
test: /[\\/]node_modules[\\/](@elliemae)[\\/]/,
|
|
66
|
-
priority: 1
|
|
66
|
+
priority: process.env.SPLIT_FRAMEWORK_CHUNK === "true" ? 3 : 1
|
|
67
|
+
},
|
|
68
|
+
...process.env.SPLIT_FRAMEWORK_CHUNK === "true" && {
|
|
69
|
+
framework: {
|
|
70
|
+
name: "framework",
|
|
71
|
+
test: /[\\/]node_modules[\\/](react|react-dom|scheduler|react-router|react-router-dom|history|react-is)[\\/]/,
|
|
72
|
+
priority: 2,
|
|
73
|
+
enforce: true
|
|
74
|
+
}
|
|
67
75
|
},
|
|
68
76
|
vendors: {
|
|
69
77
|
name: "vendors",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
3
4
|
import { GenerateSW } from "workbox-webpack-plugin";
|
|
4
5
|
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
@@ -12,6 +13,8 @@ import {
|
|
|
12
13
|
isGoogleTagManagerEnabled,
|
|
13
14
|
getCompressionPlugins
|
|
14
15
|
} from "./helpers.js";
|
|
16
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const propTypesShim = path.resolve(__dirname, "prop-types-shim.js");
|
|
15
18
|
const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
16
19
|
const { buildPath } = getPaths(latestVersion);
|
|
17
20
|
return {
|
|
@@ -39,13 +42,25 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
39
42
|
})
|
|
40
43
|
],
|
|
41
44
|
runtimeChunk: true,
|
|
45
|
+
// Three-tier chunking strategy (opt-in via SPLIT_FRAMEWORK_CHUNK=true):
|
|
46
|
+
// emui – @elliemae packages (design system, SDK)
|
|
47
|
+
// framework – React core + router (changes rarely, great cache hit)
|
|
48
|
+
// vendors – everything else from node_modules
|
|
42
49
|
splitChunks: {
|
|
43
50
|
chunks: "all",
|
|
44
51
|
cacheGroups: {
|
|
45
52
|
emui: {
|
|
46
53
|
name: "emui",
|
|
47
54
|
test: /[\\/]node_modules[\\/](@elliemae)[\\/]/,
|
|
48
|
-
priority: 1
|
|
55
|
+
priority: process.env.SPLIT_FRAMEWORK_CHUNK === "true" ? 3 : 1
|
|
56
|
+
},
|
|
57
|
+
...process.env.SPLIT_FRAMEWORK_CHUNK === "true" && {
|
|
58
|
+
framework: {
|
|
59
|
+
name: "framework",
|
|
60
|
+
test: /[\\/]node_modules[\\/](react|react-dom|scheduler|react-router|react-router-dom|history|react-is)[\\/]/,
|
|
61
|
+
priority: 2,
|
|
62
|
+
enforce: true
|
|
63
|
+
}
|
|
49
64
|
},
|
|
50
65
|
vendors: {
|
|
51
66
|
name: "vendors",
|
|
@@ -73,6 +88,11 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
73
88
|
})
|
|
74
89
|
],
|
|
75
90
|
devtool: "source-map",
|
|
91
|
+
resolve: {
|
|
92
|
+
alias: {
|
|
93
|
+
"prop-types": propTypesShim
|
|
94
|
+
}
|
|
95
|
+
},
|
|
76
96
|
performance: {
|
|
77
97
|
assetFilter: (assetFilename) => !/(\.map$)|(^(main\.|favicon\.))/.test(assetFilename)
|
|
78
98
|
}
|
|
@@ -6,7 +6,18 @@ export declare const excludeNodeModulesExcept: (modules: string[]) => (modulePat
|
|
|
6
6
|
export declare const getLibraryName: () => string;
|
|
7
7
|
export declare const getLibraryVariableName: () => string[];
|
|
8
8
|
export declare const mapToFolder: (dependencies: string[], folder: string) => {};
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Build the `resolve.alias` map that ensures only a single copy of
|
|
11
|
+
* core dependencies is bundled, even in monorepos with hoisted packages.
|
|
12
|
+
*
|
|
13
|
+
* `lodash-es` is explicitly aliased to `lodash` so that transitive
|
|
14
|
+
* imports of `lodash-es` (e.g. from design-system packages) resolve to
|
|
15
|
+
* the same CommonJS lodash build, avoiding a duplicate ~70 kB gzip hit.
|
|
16
|
+
* @returns {Record<string, string>} alias map for webpack resolve.alias
|
|
17
|
+
*/
|
|
18
|
+
export declare const getAlias: () => {
|
|
19
|
+
'lodash-es': string;
|
|
20
|
+
};
|
|
10
21
|
export declare const getLibraryAlias: (name: string, alias: string) => {
|
|
11
22
|
[x: string]: string;
|
|
12
23
|
};
|