@elliemae/pui-cli 7.0.0-alpha.1 → 7.0.0-alpha.12
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/{lib/babel/babel.config.js → dist/cjs/babel.config.cjs} +2 -6
- package/dist/cjs/cli.js +49 -0
- package/dist/cjs/commands/build.js +72 -0
- package/dist/cjs/commands/codemod.js +51 -0
- package/dist/cjs/commands/gendoc.js +52 -0
- package/dist/cjs/commands/lint.js +86 -0
- package/dist/cjs/commands/pack.js +88 -0
- package/dist/cjs/commands/start.js +61 -0
- package/dist/cjs/commands/storybook.js +63 -0
- package/dist/cjs/commands/test.js +86 -0
- package/dist/cjs/commands/tscheck.js +85 -0
- package/dist/cjs/commands/utils.js +137 -0
- package/dist/cjs/commands/version.js +71 -0
- package/dist/cjs/commands/vitest.js +87 -0
- package/{lib/dummy.ts → dist/cjs/dummy.js} +0 -0
- package/dist/cjs/index.cjs +25 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/jsdoc.conf.json +17 -0
- package/dist/cjs/lint-config/commitlint.config.cjs +1 -0
- package/{lib/lint/eslint/common.js → dist/cjs/lint-config/eslint/common.cjs} +5 -5
- package/{lib/lint/eslint/non-react.js → dist/cjs/lint-config/eslint/non-react.cjs} +2 -2
- package/{lib/lint/eslint/react.js → dist/cjs/lint-config/eslint/react.cjs} +2 -2
- package/{lib/lint/eslint/typescript/common.js → dist/cjs/lint-config/eslint/typescript/common.cjs} +1 -1
- package/{lib/lint/eslint/typescript/non-react.js → dist/cjs/lint-config/eslint/typescript/non-react.cjs} +2 -2
- package/{lib/lint/eslint/typescript/react.js → dist/cjs/lint-config/eslint/typescript/react.cjs} +2 -2
- package/dist/cjs/lint-config/lint-staged.config.js +37 -0
- package/{lib/lint/prettier.config.js → dist/cjs/lint-config/prettier.config.cjs} +1 -1
- package/{lib/lint/stylelint.config.js → dist/cjs/lint-config/stylelint.config.cjs} +2 -2
- package/dist/cjs/monorepo/delete-merged-tags.js +57 -0
- package/dist/cjs/monorepo/set-registry-version.js +43 -0
- package/dist/cjs/monorepo/set-workspace-version.js +44 -0
- package/{lib/monorepo/utils.js → dist/cjs/monorepo/utils.cjs} +17 -2
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/pui-config.js +40 -0
- package/{lib/release/release.config.js → dist/cjs/release.config.cjs} +0 -0
- package/{lib/server/util/index.js → dist/cjs/server/app-routes.cjs} +5 -15
- package/dist/cjs/server/csp.js +88 -0
- package/dist/cjs/server/index.js +30 -0
- package/dist/cjs/server/logger.js +50 -0
- package/dist/cjs/server/middlewares.js +68 -0
- package/dist/cjs/server/utils.js +32 -0
- package/{lib/testing/jest.config.js → dist/cjs/testing/jest.config.cjs} +6 -9
- package/{lib/testing/jest.node.config.js → dist/cjs/testing/jest.node.config.cjs} +1 -1
- package/dist/cjs/testing/mocks/axios.js +37 -0
- package/dist/cjs/testing/mocks/cssModule.js +23 -0
- package/dist/cjs/testing/mocks/html.js +23 -0
- package/dist/cjs/testing/mocks/image.js +23 -0
- package/dist/cjs/testing/mocks/matchMedia.js +43 -0
- package/dist/cjs/testing/mocks/pui-app-loader.js +24 -0
- package/dist/cjs/testing/mocks/pui-diagnostics.js +68 -0
- package/dist/cjs/testing/mocks/pui-user-monitoring.js +30 -0
- package/dist/cjs/testing/mocks/retry-axios.js +27 -0
- package/dist/cjs/testing/mocks/svg.js +29 -0
- package/dist/cjs/testing/mocks/webpack-hmr.js +24 -0
- package/{lib/testing/resolver.js → dist/cjs/testing/resolver.cjs} +0 -0
- package/dist/cjs/testing/setup-react-env.js +18 -0
- package/dist/cjs/testing/setup-tests.js +63 -0
- package/dist/cjs/testing/vitest.config.js +34 -0
- package/{lib/testing/vitest.setup.ts → dist/cjs/testing/vitest.setup.js} +0 -0
- package/{lib → dist/cjs}/transpile/.swcrc +0 -0
- package/dist/cjs/transpile/esbuild.js +139 -0
- package/dist/cjs/transpile/react-shim.js +26 -0
- package/{lib/transpile/swcrc.config.js → dist/cjs/transpile/swcrc.config.cjs} +1 -1
- package/{lib → dist/cjs}/typescript/app.tsconfig.json +0 -0
- package/{lib → dist/cjs}/typescript/library.tsconfig.json +0 -0
- package/dist/cjs/update-notifier.js +33 -0
- package/dist/cjs/utils.cjs +23 -0
- package/dist/cjs/webpack/helpers.js +216 -0
- package/dist/cjs/webpack/webpack.base.babel.js +262 -0
- package/dist/cjs/webpack/webpack.dev.babel.js +140 -0
- package/dist/cjs/webpack/webpack.lib.base.babel.js +217 -0
- package/dist/cjs/webpack/webpack.lib.dev.babel.js +67 -0
- package/dist/cjs/webpack/webpack.lib.prod.babel.js +92 -0
- package/dist/cjs/webpack/webpack.prod.babel.js +139 -0
- package/dist/cjs/webpack/webpack.storybook.js +122 -0
- package/dist/esm/babel.config.cjs +97 -0
- package/dist/esm/cli.js +33 -0
- package/dist/esm/commands/build.js +56 -0
- package/dist/esm/commands/codemod.js +29 -0
- package/dist/esm/commands/gendoc.js +29 -0
- package/dist/esm/commands/lint.js +64 -0
- package/dist/esm/commands/pack.js +65 -0
- package/dist/esm/commands/start.js +38 -0
- package/dist/esm/commands/storybook.js +41 -0
- package/dist/esm/commands/test.js +64 -0
- package/dist/esm/commands/tscheck.js +65 -0
- package/dist/esm/commands/utils.js +120 -0
- package/dist/esm/commands/version.js +49 -0
- package/dist/esm/commands/vitest.js +64 -0
- package/dist/esm/dummy.js +0 -0
- package/dist/esm/index.cjs +25 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/jsdoc.conf.json +17 -0
- package/dist/esm/lint-config/commitlint.config.cjs +1 -0
- package/dist/esm/lint-config/eslint/common.cjs +160 -0
- package/dist/esm/lint-config/eslint/non-react.cjs +14 -0
- package/dist/esm/lint-config/eslint/react.cjs +26 -0
- package/dist/esm/lint-config/eslint/typescript/common.cjs +43 -0
- package/dist/esm/lint-config/eslint/typescript/non-react.cjs +12 -0
- package/dist/esm/lint-config/eslint/typescript/react.cjs +19 -0
- package/dist/esm/lint-config/lint-staged.config.js +15 -0
- package/dist/esm/lint-config/prettier.config.cjs +8 -0
- package/dist/esm/lint-config/stylelint.config.cjs +19 -0
- package/dist/esm/monorepo/delete-merged-tags.js +38 -0
- package/dist/esm/monorepo/set-registry-version.js +21 -0
- package/dist/esm/monorepo/set-workspace-version.js +22 -0
- package/dist/esm/monorepo/utils.cjs +30 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/pui-config.js +18 -0
- package/dist/esm/release.config.cjs +31 -0
- package/dist/esm/server/app-routes.cjs +42 -0
- package/dist/esm/server/csp.js +66 -0
- package/dist/esm/server/index.js +18 -0
- package/dist/esm/server/logger.js +28 -0
- package/dist/esm/server/middlewares.js +46 -0
- package/dist/esm/server/utils.js +10 -0
- package/dist/esm/testing/jest.config.cjs +102 -0
- package/dist/esm/testing/jest.node.config.cjs +8 -0
- package/{lib → dist/esm}/testing/mocks/axios.js +8 -5
- package/dist/esm/testing/mocks/cssModule.js +4 -0
- package/dist/esm/testing/mocks/html.js +4 -0
- package/dist/esm/testing/mocks/image.js +4 -0
- package/dist/esm/testing/mocks/matchMedia.js +24 -0
- package/dist/esm/testing/mocks/pui-app-loader.js +5 -0
- package/dist/esm/testing/mocks/pui-diagnostics.js +49 -0
- package/dist/esm/testing/mocks/pui-user-monitoring.js +11 -0
- package/dist/esm/testing/mocks/retry-axios.js +8 -0
- package/dist/esm/testing/mocks/svg.js +7 -0
- package/dist/esm/testing/mocks/webpack-hmr.js +5 -0
- package/dist/esm/testing/resolver.cjs +47 -0
- package/dist/esm/testing/setup-react-env.js +3 -0
- package/dist/esm/testing/setup-tests.js +48 -0
- package/dist/esm/testing/vitest.config.js +15 -0
- package/dist/esm/testing/vitest.setup.js +0 -0
- package/dist/esm/transpile/.swcrc +11 -0
- package/dist/esm/transpile/esbuild.js +118 -0
- package/dist/esm/transpile/react-shim.js +4 -0
- package/dist/esm/transpile/swcrc.config.cjs +13 -0
- package/dist/esm/typescript/app.tsconfig.json +23 -0
- package/dist/esm/typescript/library.tsconfig.json +23 -0
- package/dist/esm/update-notifier.js +11 -0
- package/dist/esm/utils.cjs +23 -0
- package/dist/esm/webpack/helpers.js +196 -0
- package/dist/esm/webpack/webpack.base.babel.js +248 -0
- package/dist/esm/webpack/webpack.dev.babel.js +121 -0
- package/dist/esm/webpack/webpack.lib.base.babel.js +208 -0
- package/dist/esm/webpack/webpack.lib.dev.babel.js +45 -0
- package/dist/esm/webpack/webpack.lib.prod.babel.js +70 -0
- package/dist/esm/webpack/webpack.prod.babel.js +122 -0
- package/dist/esm/webpack/webpack.storybook.js +102 -0
- package/dist/types/babel.config.d.cts +59 -0
- package/dist/types/cli.d.ts +2 -0
- package/dist/types/commands/build.d.ts +14 -0
- package/dist/types/commands/codemod.d.ts +6 -0
- package/dist/types/commands/gendoc.d.ts +6 -0
- package/dist/types/commands/lint.d.ts +29 -0
- package/dist/types/commands/pack.d.ts +26 -0
- package/dist/types/commands/start.d.ts +13 -0
- package/dist/types/commands/storybook.d.ts +19 -0
- package/dist/types/commands/test.d.ts +35 -0
- package/dist/types/commands/tscheck.d.ts +14 -0
- package/dist/types/commands/utils.d.ts +14 -0
- package/dist/types/commands/version.d.ts +30 -0
- package/dist/types/commands/vitest.d.ts +35 -0
- package/dist/types/dummy.d.ts +0 -0
- package/dist/types/index.d.cts +10 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/lint-config/commitlint.config.d.cts +4 -0
- package/dist/types/lint-config/eslint/common.d.cts +127 -0
- package/dist/types/lint-config/eslint/non-react.d.cts +93 -0
- package/dist/types/lint-config/eslint/react.d.cts +123 -0
- package/dist/types/lint-config/eslint/typescript/common.d.cts +37 -0
- package/dist/types/lint-config/eslint/typescript/non-react.d.cts +87 -0
- package/dist/types/lint-config/eslint/typescript/react.d.cts +118 -0
- package/dist/types/lint-config/lint-staged.config.d.ts +5 -0
- package/dist/types/lint-config/prettier.config.d.cts +8 -0
- package/dist/types/lint-config/stylelint.config.d.cts +11 -0
- package/dist/types/monorepo/delete-merged-tags.d.ts +1 -0
- package/dist/types/monorepo/set-registry-version.d.ts +1 -0
- package/dist/types/monorepo/set-workspace-version.d.ts +1 -0
- package/dist/types/monorepo/utils.d.cts +1 -0
- package/dist/types/pui-config.d.ts +1 -0
- package/dist/types/release.config.d.cts +9 -0
- package/dist/types/server/app-routes.d.cts +1 -0
- package/dist/types/server/csp.d.ts +10 -0
- package/dist/types/server/index.d.ts +1 -0
- package/dist/types/server/logger.d.ts +4 -0
- package/dist/types/server/middlewares.d.ts +2 -0
- package/dist/types/server/utils.d.ts +3 -0
- package/dist/types/testing/jest.config.d.cts +38 -0
- package/dist/types/testing/jest.node.config.d.cts +38 -0
- package/dist/types/testing/mocks/axios.d.ts +17 -0
- package/dist/types/testing/mocks/cssModule.d.ts +2 -0
- package/dist/types/testing/mocks/html.d.ts +2 -0
- package/dist/types/testing/mocks/image.d.ts +2 -0
- package/dist/types/testing/mocks/matchMedia.d.ts +1 -0
- package/dist/types/testing/mocks/pui-app-loader.d.ts +1 -0
- package/dist/types/testing/mocks/pui-diagnostics.d.ts +28 -0
- package/dist/types/testing/mocks/pui-user-monitoring.d.ts +3 -0
- package/dist/types/testing/mocks/retry-axios.d.ts +3 -0
- package/dist/types/testing/mocks/svg.d.ts +3 -0
- package/dist/types/testing/mocks/webpack-hmr.d.ts +1 -0
- package/dist/types/testing/resolver.d.cts +2 -0
- package/dist/types/testing/setup-react-env.d.ts +1 -0
- package/dist/types/testing/setup-tests.d.ts +1 -0
- package/dist/types/testing/vitest.config.d.ts +2 -0
- package/dist/types/testing/vitest.setup.d.ts +0 -0
- package/dist/types/transpile/esbuild.d.ts +13 -0
- package/dist/types/transpile/react-shim.d.ts +2 -0
- package/dist/types/transpile/swcrc.config.d.cts +1 -0
- package/dist/types/update-notifier.d.ts +1 -0
- package/dist/types/utils.d.cts +4 -0
- package/dist/types/webpack/helpers.d.ts +28 -0
- package/dist/types/webpack/webpack.base.babel.d.ts +90 -0
- package/dist/types/webpack/webpack.dev.babel.d.ts +2 -0
- package/dist/types/webpack/webpack.lib.base.babel.d.ts +107 -0
- package/dist/types/webpack/webpack.lib.dev.babel.d.ts +91 -0
- package/dist/types/webpack/webpack.lib.prod.babel.d.ts +91 -0
- package/dist/types/webpack/webpack.prod.babel.d.ts +2 -0
- package/dist/types/webpack/webpack.storybook.d.ts +4 -0
- package/package.json +62 -53
- package/lib/cli-commands/build.js +0 -60
- package/lib/cli-commands/codemod.js +0 -31
- package/lib/cli-commands/gendoc.js +0 -36
- package/lib/cli-commands/lint.js +0 -75
- package/lib/cli-commands/pack.js +0 -67
- package/lib/cli-commands/start.js +0 -49
- package/lib/cli-commands/storybook.js +0 -53
- package/lib/cli-commands/test.js +0 -63
- package/lib/cli-commands/tsc.js +0 -103
- package/lib/cli-commands/utils.js +0 -135
- package/lib/cli-commands/version.js +0 -53
- package/lib/cli-commands/vitest.js +0 -66
- package/lib/cli.js +0 -33
- package/lib/docgen/jsdoc.config.js +0 -17
- package/lib/index.js +0 -25
- package/lib/lint/commitlint.config.js +0 -1
- package/lib/lint/lint-staged.config.js +0 -16
- package/lib/monorepo/delete-merged-tags.js +0 -48
- package/lib/monorepo/set-registry-version.js +0 -22
- package/lib/monorepo/set-workspace-version.js +0 -29
- package/lib/pui-config/index.js +0 -18
- package/lib/scripts/helpers/checkmark.js +0 -15
- package/lib/scripts/helpers/get-npm-config.js +0 -3
- package/lib/scripts/helpers/progress.js +0 -19
- package/lib/scripts/helpers/xmark.js +0 -13
- package/lib/scripts/npmcheckversion.js +0 -8
- package/lib/scripts/update-notifier.js +0 -7
- package/lib/server/csp.js +0 -74
- package/lib/server/index.js +0 -37
- package/lib/server/logger.js +0 -42
- package/lib/server/middlewares/addDevMiddlewares.js +0 -39
- package/lib/server/middlewares/addProdMiddlewares.js +0 -30
- package/lib/server/middlewares/index.js +0 -37
- package/lib/testing/mocks/cssModule.js +0 -1
- package/lib/testing/mocks/html.js +0 -1
- package/lib/testing/mocks/image.js +0 -1
- package/lib/testing/mocks/matchMedia.js +0 -24
- package/lib/testing/mocks/pui-app-loader.js +0 -1
- package/lib/testing/mocks/pui-diagnostics.js +0 -28
- package/lib/testing/mocks/pui-user-monitoring.js +0 -3
- package/lib/testing/mocks/retry-axios.js +0 -3
- package/lib/testing/mocks/svg.js +0 -5
- package/lib/testing/mocks/webpack-hmr.js +0 -1
- package/lib/testing/setup-react-env.js +0 -3
- package/lib/testing/setup-tests.js +0 -58
- package/lib/testing/vitest.config.ts +0 -16
- package/lib/transpile/esbuild.js +0 -116
- package/lib/transpile/react-shim.js +0 -2
- package/lib/typescript/tsc-files/index.js +0 -66
- package/lib/typescript/tsc-files/utils.js +0 -16
- package/lib/typescript/util.js +0 -5
- package/lib/webpack/helpers.js +0 -252
- package/lib/webpack/webpack.base.babel.js +0 -242
- package/lib/webpack/webpack.dev.babel.js +0 -137
- package/lib/webpack/webpack.lib.base.babel.js +0 -205
- package/lib/webpack/webpack.lib.dev.babel.js +0 -49
- package/lib/webpack/webpack.lib.prod.babel.js +0 -77
- package/lib/webpack/webpack.prod.babel.js +0 -142
- package/lib/webpack/webpack.storybook.js +0 -87
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
import webpack from "webpack";
|
|
19
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
20
|
+
import PostcssPresetEnv from "postcss-preset-env";
|
|
21
|
+
import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
22
|
+
import DuplicatePackageCheckerPlugin from "duplicate-package-checker-webpack-plugin";
|
|
23
|
+
import MomentLocalesPlugin from "moment-locales-webpack-plugin";
|
|
24
|
+
import { WebpackManifestPlugin } from "webpack-manifest-plugin";
|
|
25
|
+
import FaviconsWebpackPlugin from "favicons-webpack-plugin";
|
|
26
|
+
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
27
|
+
import {
|
|
28
|
+
excludeNodeModulesExcept,
|
|
29
|
+
modulesToTranspile,
|
|
30
|
+
getAlias,
|
|
31
|
+
getPaths,
|
|
32
|
+
filterByFilePresence
|
|
33
|
+
} from "./helpers.js";
|
|
34
|
+
const minicssLoader = {
|
|
35
|
+
loader: MiniCssExtractPlugin.loader,
|
|
36
|
+
options: {}
|
|
37
|
+
};
|
|
38
|
+
const finalCSSLoader = (mode) => mode !== "production" ? { loader: "style-loader" } : minicssLoader;
|
|
39
|
+
const postcssPlugins = [PostcssPresetEnv({ autoprefixer: { grid: true } })];
|
|
40
|
+
const { buildPath } = getPaths();
|
|
41
|
+
const plugins = [
|
|
42
|
+
new webpack.EnvironmentPlugin({
|
|
43
|
+
NODE_ENV: "development",
|
|
44
|
+
CI: "false"
|
|
45
|
+
}),
|
|
46
|
+
new webpack.ProvidePlugin({
|
|
47
|
+
React: "react"
|
|
48
|
+
}),
|
|
49
|
+
new CopyWebpackPlugin({
|
|
50
|
+
patterns: filterByFilePresence([
|
|
51
|
+
{
|
|
52
|
+
from: "app/app.config.json",
|
|
53
|
+
to: "./latest/app.config.json"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
from: "app/robots.txt",
|
|
57
|
+
to: "robots.txt",
|
|
58
|
+
noErrorOnMissing: true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
from: "app/global*.js",
|
|
62
|
+
to: "./latest/js/[name][ext]"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
from: "node_modules/@elliemae/pui-user-monitoring/dist/public/js",
|
|
66
|
+
to: "./latest/js",
|
|
67
|
+
toType: "dir",
|
|
68
|
+
info: { minimized: true }
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
from: "node_modules/@elliemae/pui-app-loader/dist/public/js",
|
|
72
|
+
to: "./latest/js",
|
|
73
|
+
toType: "dir",
|
|
74
|
+
noErrorOnMissing: true,
|
|
75
|
+
info: { minimized: true }
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
from: "node_modules/@elliemae/encw-loader/dist/public/js",
|
|
79
|
+
to: "./latest/js",
|
|
80
|
+
toType: "dir",
|
|
81
|
+
noErrorOnMissing: true,
|
|
82
|
+
info: { minimized: true }
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
from: "node_modules/@elliemae/pui-diagnostics/dist/public/js",
|
|
86
|
+
to: "./latest/js",
|
|
87
|
+
toType: "dir",
|
|
88
|
+
noErrorOnMissing: true,
|
|
89
|
+
info: { minimized: true }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
from: "public",
|
|
93
|
+
to: "./latest",
|
|
94
|
+
noErrorOnMissing: true,
|
|
95
|
+
globOptions: {
|
|
96
|
+
ignore: ["readme.md"]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
from: "webroot",
|
|
101
|
+
noErrorOnMissing: true,
|
|
102
|
+
globOptions: {
|
|
103
|
+
ignore: ["readme.md"]
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
])
|
|
107
|
+
}),
|
|
108
|
+
new DuplicatePackageCheckerPlugin(),
|
|
109
|
+
new MomentLocalesPlugin({ localesToKeep: ["es-us"] }),
|
|
110
|
+
new WebpackManifestPlugin({
|
|
111
|
+
fileName: "./latest/manifest.json",
|
|
112
|
+
publicPath: "",
|
|
113
|
+
map: (file) => {
|
|
114
|
+
file.name = file.name.replace(/^latest\//, "");
|
|
115
|
+
return file;
|
|
116
|
+
}
|
|
117
|
+
}),
|
|
118
|
+
new FaviconsWebpackPlugin({
|
|
119
|
+
outputPath: "./latest/assets",
|
|
120
|
+
logo: "./app/view/images/favicon.png",
|
|
121
|
+
favicons: {
|
|
122
|
+
developerName: "ICE MT",
|
|
123
|
+
developerURL: null,
|
|
124
|
+
icons: {
|
|
125
|
+
coast: false,
|
|
126
|
+
yandex: false
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}),
|
|
130
|
+
new webpack.ProgressPlugin()
|
|
131
|
+
];
|
|
132
|
+
const baseConfig = (options) => ({
|
|
133
|
+
mode: options.mode,
|
|
134
|
+
entry: options.entry,
|
|
135
|
+
output: __spreadValues({
|
|
136
|
+
clean: true,
|
|
137
|
+
path: buildPath,
|
|
138
|
+
publicPath: "auto"
|
|
139
|
+
}, options.output),
|
|
140
|
+
optimization: options.optimization,
|
|
141
|
+
module: {
|
|
142
|
+
rules: [
|
|
143
|
+
{
|
|
144
|
+
test: /\.jsx?$/,
|
|
145
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
146
|
+
resolve: {
|
|
147
|
+
fullySpecified: false
|
|
148
|
+
},
|
|
149
|
+
use: {
|
|
150
|
+
loader: "esbuild-loader",
|
|
151
|
+
options: {
|
|
152
|
+
loader: "jsx",
|
|
153
|
+
target: browserslistToEsbuild()
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
test: /\.tsx?$/,
|
|
159
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
160
|
+
resolve: {
|
|
161
|
+
fullySpecified: false
|
|
162
|
+
},
|
|
163
|
+
use: {
|
|
164
|
+
loader: "esbuild-loader",
|
|
165
|
+
options: {
|
|
166
|
+
loader: "tsx",
|
|
167
|
+
target: browserslistToEsbuild()
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
test: /\.css$/,
|
|
173
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
174
|
+
use: [
|
|
175
|
+
finalCSSLoader(options.mode),
|
|
176
|
+
{
|
|
177
|
+
loader: "css-loader",
|
|
178
|
+
options: {
|
|
179
|
+
importLoaders: 1,
|
|
180
|
+
sourceMap: true
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
loader: "postcss-loader",
|
|
185
|
+
options: {
|
|
186
|
+
postcssOptions: {
|
|
187
|
+
plugins: postcssPlugins
|
|
188
|
+
},
|
|
189
|
+
sourceMap: true
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
test: /\.(woff|woff2)$/,
|
|
196
|
+
type: "asset/resource",
|
|
197
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile)
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
test: /\.svg$/i,
|
|
201
|
+
issuer: /\.[jt]sx?$/,
|
|
202
|
+
resourceQuery: /^((?!url).)*$/,
|
|
203
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
204
|
+
use: ["@svgr/webpack"]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
test: /\.(jpe?g|png|gif|ico|mp4|webm)$/i,
|
|
208
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
209
|
+
type: "asset"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
resourceQuery: /resource/,
|
|
213
|
+
type: "asset/resource",
|
|
214
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile)
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
type: "asset",
|
|
218
|
+
resourceQuery: /url/,
|
|
219
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile)
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
plugins: plugins.concat(options.plugins),
|
|
224
|
+
resolve: {
|
|
225
|
+
modules: [
|
|
226
|
+
"node_modules",
|
|
227
|
+
"app",
|
|
228
|
+
"lib",
|
|
229
|
+
path.resolve(process.cwd(), "node_modules"),
|
|
230
|
+
path.resolve(process.cwd(), "app"),
|
|
231
|
+
path.resolve(process.cwd(), "lib")
|
|
232
|
+
],
|
|
233
|
+
extensions: [".js", ".jsx", ".ts", ".tsx", ".json", ".wasm", ".mjs"],
|
|
234
|
+
mainFields: ["browser", "module", "main"],
|
|
235
|
+
alias: __spreadValues(__spreadValues({}, getAlias()), (options.resolve || {}).alias || {})
|
|
236
|
+
},
|
|
237
|
+
externals: {
|
|
238
|
+
"@elliemae/pui-user-monitoring": "emuiUserMonitoring",
|
|
239
|
+
"@elliemae/pui-app-loader": "emuiAppLoader",
|
|
240
|
+
"@elliemae/pui-diagnostics": "emuiDiagnostics"
|
|
241
|
+
},
|
|
242
|
+
devtool: options.devtool || "eval-source-map",
|
|
243
|
+
performance: options.performance || {},
|
|
244
|
+
devServer: options.devServer || {}
|
|
245
|
+
});
|
|
246
|
+
export {
|
|
247
|
+
baseConfig
|
|
248
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
4
|
+
import CircularDependencyPlugin from "circular-dependency-plugin";
|
|
5
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
6
|
+
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
|
|
7
|
+
import SpeedMeasurePlugin from "speed-measure-webpack-plugin";
|
|
8
|
+
import expressStaticGzip from "express-static-gzip";
|
|
9
|
+
import { setupDefaultMiddlewares } from "../server/middlewares.js";
|
|
10
|
+
import { loadRoutes } from "../server/app-routes.cjs";
|
|
11
|
+
import {
|
|
12
|
+
isAppLoaderEnabled,
|
|
13
|
+
getPaths,
|
|
14
|
+
isGoogleTagManagerEnabled
|
|
15
|
+
} from "./helpers.js";
|
|
16
|
+
import { baseConfig } from "./webpack.base.babel.js";
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
|
|
19
|
+
const {
|
|
20
|
+
appVersion,
|
|
21
|
+
buildPath,
|
|
22
|
+
basePath,
|
|
23
|
+
userMonScriptPath,
|
|
24
|
+
globalScriptPath,
|
|
25
|
+
appLoaderScriptPath,
|
|
26
|
+
diagnosticsScriptPath,
|
|
27
|
+
encwLoaderScriptPath
|
|
28
|
+
} = getPaths();
|
|
29
|
+
const devConfig = {
|
|
30
|
+
mode: "development",
|
|
31
|
+
cache: {
|
|
32
|
+
type: "filesystem",
|
|
33
|
+
allowCollectingMemory: true,
|
|
34
|
+
buildDependencies: {
|
|
35
|
+
config: [__filename]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
entry: {
|
|
39
|
+
app: path.join(process.cwd(), "app/index")
|
|
40
|
+
},
|
|
41
|
+
output: {
|
|
42
|
+
path: buildPath,
|
|
43
|
+
publicPath: "auto",
|
|
44
|
+
filename: "[name].js",
|
|
45
|
+
chunkFilename: "[name].chunk.js",
|
|
46
|
+
assetModuleFilename: "[name][ext][query]"
|
|
47
|
+
},
|
|
48
|
+
optimization: {
|
|
49
|
+
splitChunks: {
|
|
50
|
+
chunks: "all",
|
|
51
|
+
cacheGroups: {
|
|
52
|
+
emui: {
|
|
53
|
+
name: "emui",
|
|
54
|
+
test: /[\\/]node_modules[\\/](@elliemae)[\\/]/,
|
|
55
|
+
priority: 1
|
|
56
|
+
},
|
|
57
|
+
vendors: {
|
|
58
|
+
name: "vendors",
|
|
59
|
+
test: /[\\/]node_modules[\\/]/
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
resolve: {
|
|
65
|
+
alias: {}
|
|
66
|
+
},
|
|
67
|
+
plugins: [
|
|
68
|
+
new HtmlWebpackPlugin({
|
|
69
|
+
inject: !isAppLoaderEnabled(),
|
|
70
|
+
template: !isAppLoaderEnabled() ? "app/index.html" : "app/index-app-loader.html",
|
|
71
|
+
emui: {
|
|
72
|
+
appVersion,
|
|
73
|
+
globalScriptPath,
|
|
74
|
+
userMonScriptPath,
|
|
75
|
+
appLoaderScriptPath,
|
|
76
|
+
diagnosticsScriptPath,
|
|
77
|
+
encwLoaderScriptPath,
|
|
78
|
+
googleTagManager: isGoogleTagManagerEnabled()
|
|
79
|
+
}
|
|
80
|
+
}),
|
|
81
|
+
new CircularDependencyPlugin({
|
|
82
|
+
exclude: /a\.(js|ts|jsx|tsx)|node_modules/,
|
|
83
|
+
failOnError: false
|
|
84
|
+
}),
|
|
85
|
+
new MiniCssExtractPlugin({
|
|
86
|
+
filename: "[name].css",
|
|
87
|
+
chunkFilename: "[name].chunk.css"
|
|
88
|
+
})
|
|
89
|
+
],
|
|
90
|
+
devtool: "eval-source-map",
|
|
91
|
+
performance: {
|
|
92
|
+
hints: false
|
|
93
|
+
},
|
|
94
|
+
devServer: {
|
|
95
|
+
client: {
|
|
96
|
+
overlay: {
|
|
97
|
+
errors: true,
|
|
98
|
+
warnings: false
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
devMiddleware: {
|
|
102
|
+
publicPath: basePath
|
|
103
|
+
},
|
|
104
|
+
historyApiFallback: true,
|
|
105
|
+
hot: true,
|
|
106
|
+
open: [basePath],
|
|
107
|
+
port: 3e3,
|
|
108
|
+
setupMiddlewares: (middlewares, devServer) => {
|
|
109
|
+
setupDefaultMiddlewares(devServer.app);
|
|
110
|
+
devServer.app.use(expressStaticGzip("cdn"));
|
|
111
|
+
loadRoutes(devServer.app);
|
|
112
|
+
return middlewares;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const config = smp.wrap(baseConfig(devConfig));
|
|
117
|
+
config.plugins = config.plugins.concat([new ReactRefreshWebpackPlugin({})]);
|
|
118
|
+
var webpack_dev_babel_default = config;
|
|
119
|
+
export {
|
|
120
|
+
webpack_dev_babel_default as default
|
|
121
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
import {
|
|
19
|
+
EnvironmentPlugin,
|
|
20
|
+
DefinePlugin,
|
|
21
|
+
optimize,
|
|
22
|
+
ProgressPlugin
|
|
23
|
+
} from "webpack";
|
|
24
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
25
|
+
import CopyWebpackPlugin from "copy-webpack-plugin";
|
|
26
|
+
import PostcssPresetEnv from "postcss-preset-env";
|
|
27
|
+
import DuplicatePackageCheckerPlugin from "duplicate-package-checker-webpack-plugin";
|
|
28
|
+
import MomentLocalesPlugin from "moment-locales-webpack-plugin";
|
|
29
|
+
import ResolveTypeScriptPlugin from "resolve-typescript-plugin";
|
|
30
|
+
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
31
|
+
import {
|
|
32
|
+
excludeNodeModulesExcept,
|
|
33
|
+
getLibraryName,
|
|
34
|
+
modulesToTranspile,
|
|
35
|
+
getAlias,
|
|
36
|
+
filterByFilePresence
|
|
37
|
+
} from "./helpers.js";
|
|
38
|
+
import { getAppConfig } from "../utils.cjs";
|
|
39
|
+
const minicssLoader = {
|
|
40
|
+
loader: MiniCssExtractPlugin.loader,
|
|
41
|
+
options: {}
|
|
42
|
+
};
|
|
43
|
+
const finalCSSLoader = (mode) => mode !== "production" ? { loader: "style-loader" } : minicssLoader;
|
|
44
|
+
const copyPluginPatterns = filterByFilePresence([
|
|
45
|
+
{
|
|
46
|
+
from: "lib/app.config.json",
|
|
47
|
+
to: "app.config.json",
|
|
48
|
+
noErrorOnMissing: true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
from: "public",
|
|
52
|
+
noErrorOnMissing: true
|
|
53
|
+
}
|
|
54
|
+
]);
|
|
55
|
+
const plugins = [
|
|
56
|
+
new EnvironmentPlugin({
|
|
57
|
+
ASSET_PATH: "/",
|
|
58
|
+
CI: "false"
|
|
59
|
+
}),
|
|
60
|
+
new DefinePlugin({
|
|
61
|
+
APP_CONFIG: getAppConfig(true)
|
|
62
|
+
}),
|
|
63
|
+
...copyPluginPatterns.length > 0 ? [
|
|
64
|
+
new CopyWebpackPlugin({
|
|
65
|
+
patterns: copyPluginPatterns
|
|
66
|
+
})
|
|
67
|
+
] : [],
|
|
68
|
+
new DuplicatePackageCheckerPlugin(),
|
|
69
|
+
new optimize.LimitChunkCountPlugin({
|
|
70
|
+
maxChunks: 1
|
|
71
|
+
}),
|
|
72
|
+
new MomentLocalesPlugin({ localesToKeep: ["es-us"] }),
|
|
73
|
+
new ProgressPlugin()
|
|
74
|
+
];
|
|
75
|
+
const baseConfig = (options) => ({
|
|
76
|
+
mode: options.mode,
|
|
77
|
+
entry: [path.join(process.cwd(), "lib/index")],
|
|
78
|
+
output: __spreadValues({
|
|
79
|
+
clean: true,
|
|
80
|
+
path: path.resolve(process.cwd(), "dist/public"),
|
|
81
|
+
publicPath: "auto",
|
|
82
|
+
library: getLibraryName(),
|
|
83
|
+
libraryTarget: "umd"
|
|
84
|
+
}, options.output),
|
|
85
|
+
optimization: options.optimization,
|
|
86
|
+
module: {
|
|
87
|
+
rules: [
|
|
88
|
+
{
|
|
89
|
+
test: /^(?!.*\.exec\.js$).*\.jsx?$/,
|
|
90
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
91
|
+
resolve: {
|
|
92
|
+
fullySpecified: false
|
|
93
|
+
},
|
|
94
|
+
use: {
|
|
95
|
+
loader: "esbuild-loader",
|
|
96
|
+
options: {
|
|
97
|
+
loader: "jsx",
|
|
98
|
+
target: browserslistToEsbuild()
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
test: /^(?!.*\.exec\.js$).*\.tsx?$/,
|
|
104
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
105
|
+
resolve: {
|
|
106
|
+
fullySpecified: false
|
|
107
|
+
},
|
|
108
|
+
use: {
|
|
109
|
+
loader: "esbuild-loader",
|
|
110
|
+
options: {
|
|
111
|
+
loader: "tsx",
|
|
112
|
+
target: browserslistToEsbuild()
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
test: /\.css$/,
|
|
118
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
119
|
+
use: [
|
|
120
|
+
finalCSSLoader(options.mode),
|
|
121
|
+
{
|
|
122
|
+
loader: "css-loader",
|
|
123
|
+
options: {
|
|
124
|
+
importLoaders: 1,
|
|
125
|
+
sourceMap: true
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
loader: "postcss-loader",
|
|
130
|
+
options: {
|
|
131
|
+
postcssOptions: {
|
|
132
|
+
plugins: [PostcssPresetEnv({ autoprefixer: { grid: true } })]
|
|
133
|
+
},
|
|
134
|
+
sourceMap: true
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
test: /\.pug$/,
|
|
141
|
+
exclude: /node_modules/,
|
|
142
|
+
use: "pug-loader"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
test: /\.(woff|woff2)$/,
|
|
146
|
+
exclude: excludeNodeModulesExcept(["@elliemae/*"]),
|
|
147
|
+
type: "asset/resource"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
test: /\.svg$/i,
|
|
151
|
+
issuer: /\.[jt]sx?$/,
|
|
152
|
+
resourceQuery: /^((?!url).)*$/,
|
|
153
|
+
exclude: excludeNodeModulesExcept(["@elliemae/*"]),
|
|
154
|
+
use: ["@svgr/webpack"]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
test: /\.(jpe?g|png|gif|ico)$/i,
|
|
158
|
+
exclude: excludeNodeModulesExcept(["@elliemae/*"]),
|
|
159
|
+
type: "asset"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
test: /(?<!\/iframe)\.html$/,
|
|
163
|
+
exclude: excludeNodeModulesExcept(["@elliemae/*"]),
|
|
164
|
+
use: "html-loader"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
test: /\.(mp4|webm)$/,
|
|
168
|
+
exclude: excludeNodeModulesExcept(["@elliemae/*"]),
|
|
169
|
+
type: "asset"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
resourceQuery: /resource/,
|
|
173
|
+
type: "asset/resource",
|
|
174
|
+
exclude: excludeNodeModulesExcept(["@elliemae/*"])
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: "asset",
|
|
178
|
+
resourceQuery: /url/,
|
|
179
|
+
exclude: excludeNodeModulesExcept(["@elliemae/*"])
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
plugins: plugins.concat(options.plugins || []),
|
|
184
|
+
resolve: {
|
|
185
|
+
modules: [
|
|
186
|
+
"node_modules",
|
|
187
|
+
"app",
|
|
188
|
+
"lib",
|
|
189
|
+
path.resolve(process.cwd(), "node_modules"),
|
|
190
|
+
path.resolve(process.cwd(), "app"),
|
|
191
|
+
path.resolve(process.cwd(), "lib")
|
|
192
|
+
],
|
|
193
|
+
extensions: [".ts", ".tsx", ".js", ".jsx", ".json", ".wasm", ".mjs"],
|
|
194
|
+
mainFields: ["browser", "module", "main"],
|
|
195
|
+
alias: __spreadValues(__spreadValues({}, getAlias()), (options.resolve || {}).alias || {}),
|
|
196
|
+
plugins: [new ResolveTypeScriptPlugin({})]
|
|
197
|
+
},
|
|
198
|
+
externals: {
|
|
199
|
+
"@elliemae/pui-user-monitoring": "emuiUserMonitoring",
|
|
200
|
+
"@elliemae/pui-app-loader": "emuiAppLoader",
|
|
201
|
+
"@elliemae/pui-diagnostics": "emuiDiagnostics"
|
|
202
|
+
},
|
|
203
|
+
devtool: options.devtool || "eval-source-map",
|
|
204
|
+
performance: options.performance || {}
|
|
205
|
+
});
|
|
206
|
+
export {
|
|
207
|
+
baseConfig
|
|
208
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import CircularDependencyPlugin from "circular-dependency-plugin";
|
|
2
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
3
|
+
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
4
|
+
import { getLibraryName } from "./helpers.js";
|
|
5
|
+
import { baseConfig } from "./webpack.base.babel.js";
|
|
6
|
+
const libraryName = getLibraryName();
|
|
7
|
+
var webpack_lib_dev_babel_default = baseConfig({
|
|
8
|
+
mode: "development",
|
|
9
|
+
output: {
|
|
10
|
+
filename: `js/${libraryName}.js`,
|
|
11
|
+
chunkFilename: `js/${libraryName}.chunk.js`,
|
|
12
|
+
assetModuleFilename: "[name][ext][query]"
|
|
13
|
+
},
|
|
14
|
+
optimization: {
|
|
15
|
+
splitChunks: {
|
|
16
|
+
chunks: "all"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
resolve: {
|
|
20
|
+
alias: {}
|
|
21
|
+
},
|
|
22
|
+
plugins: [
|
|
23
|
+
new HtmlWebpackPlugin({
|
|
24
|
+
inject: true,
|
|
25
|
+
template: "lib/index.pug",
|
|
26
|
+
filename: "index.html",
|
|
27
|
+
libraryName
|
|
28
|
+
}),
|
|
29
|
+
new CircularDependencyPlugin({
|
|
30
|
+
exclude: /a\.(js|ts|jsx|tsx)|node_modules/,
|
|
31
|
+
failOnError: false
|
|
32
|
+
}),
|
|
33
|
+
new MiniCssExtractPlugin({
|
|
34
|
+
filename: `css/${libraryName}.css`,
|
|
35
|
+
chunkFilename: `css/${libraryName}.chunk.css`
|
|
36
|
+
})
|
|
37
|
+
],
|
|
38
|
+
devtool: "eval-source-map",
|
|
39
|
+
performance: {
|
|
40
|
+
hints: false
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
webpack_lib_dev_babel_default as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
3
|
+
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
4
|
+
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer";
|
|
5
|
+
import { ESBuildMinifyPlugin } from "esbuild-loader";
|
|
6
|
+
import browserslistToEsbuild from "browserslist-to-esbuild";
|
|
7
|
+
import { getLibraryName, getCompressionPlugins } from "./helpers.js";
|
|
8
|
+
import { baseConfig } from "./webpack.base.babel.js";
|
|
9
|
+
const libraryName = getLibraryName();
|
|
10
|
+
var webpack_lib_prod_babel_default = baseConfig({
|
|
11
|
+
mode: "production",
|
|
12
|
+
output: {
|
|
13
|
+
filename: `js/${libraryName}.[chunkhash].js`,
|
|
14
|
+
chunkFilename: `js/${libraryName}.[chunkhash].chunk.js`,
|
|
15
|
+
assetModuleFilename: "assets/[name].[hash][ext][query]"
|
|
16
|
+
},
|
|
17
|
+
optimization: {
|
|
18
|
+
moduleIds: "deterministic",
|
|
19
|
+
minimize: true,
|
|
20
|
+
minimizer: [
|
|
21
|
+
new ESBuildMinifyPlugin({
|
|
22
|
+
target: browserslistToEsbuild(),
|
|
23
|
+
css: true
|
|
24
|
+
})
|
|
25
|
+
],
|
|
26
|
+
nodeEnv: "production",
|
|
27
|
+
sideEffects: true,
|
|
28
|
+
concatenateModules: true,
|
|
29
|
+
splitChunks: {
|
|
30
|
+
chunks: "all"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
plugins: [
|
|
34
|
+
new HtmlWebpackPlugin({
|
|
35
|
+
template: "lib/index.pug",
|
|
36
|
+
filename: "index.html",
|
|
37
|
+
libraryName,
|
|
38
|
+
minify: {
|
|
39
|
+
removeComments: true,
|
|
40
|
+
collapseWhitespace: true,
|
|
41
|
+
removeRedundantAttributes: true,
|
|
42
|
+
useShortDoctype: true,
|
|
43
|
+
removeEmptyAttributes: true,
|
|
44
|
+
removeStyleLinkTypeAttributes: true,
|
|
45
|
+
keepClosingSlash: true,
|
|
46
|
+
minifyJS: true,
|
|
47
|
+
minifyCSS: true,
|
|
48
|
+
minifyURLs: true
|
|
49
|
+
},
|
|
50
|
+
inject: true
|
|
51
|
+
}),
|
|
52
|
+
new MiniCssExtractPlugin({
|
|
53
|
+
filename: `css/${libraryName}.[contenthash].css`,
|
|
54
|
+
chunkFilename: `css/${libraryName}.[contenthash].chunk.css`
|
|
55
|
+
}),
|
|
56
|
+
...getCompressionPlugins(true),
|
|
57
|
+
new BundleAnalyzerPlugin({
|
|
58
|
+
analyzerMode: "static",
|
|
59
|
+
reportFilename: path.join(process.cwd(), "reports/bundle-stats.html"),
|
|
60
|
+
openAnalyzer: false
|
|
61
|
+
})
|
|
62
|
+
],
|
|
63
|
+
devtool: "source-map",
|
|
64
|
+
performance: {
|
|
65
|
+
assetFilter: (assetFilename) => !/(\.map$)|(^(main\.|favicon\.))/.test(assetFilename)
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
webpack_lib_prod_babel_default as default
|
|
70
|
+
};
|