@elliemae/pui-cli 6.0.0-beta.52 → 6.0.0-beta.56
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/cli-commands/build.js +8 -3
- package/lib/cli-commands/pack.js +11 -74
- package/lib/transpile/esbuild.js +84 -39
- package/lib/webpack/helpers.js +7 -0
- package/lib/webpack/webpack.base.babel.js +9 -2
- package/lib/webpack/webpack.lib.base.babel.js +13 -10
- package/lib/webpack/webpack.lib.dev.babel.js +1 -1
- package/lib/webpack/webpack.lib.prod.babel.js +2 -3
- package/lib/webpack/webpack.prod.babel.js +2 -3
- package/lib/webpack/webpack.storybook.js +1 -1
- package/package.json +21 -38
|
@@ -6,6 +6,7 @@ const {
|
|
|
6
6
|
logSuccess,
|
|
7
7
|
writeAppInfo,
|
|
8
8
|
} = require('./utils');
|
|
9
|
+
const { esBuild, TARGETS } = require('../transpile/esbuild');
|
|
9
10
|
|
|
10
11
|
const { name } = require('../../package.json');
|
|
11
12
|
|
|
@@ -20,9 +21,13 @@ async function buildWebApp() {
|
|
|
20
21
|
|
|
21
22
|
async function buildService() {
|
|
22
23
|
await exec('rimraf ./build');
|
|
23
|
-
await
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
await esBuild({
|
|
25
|
+
srcdir: './app',
|
|
26
|
+
outdir: 'build',
|
|
27
|
+
esmOnly: true,
|
|
28
|
+
target: TARGETS.node,
|
|
29
|
+
injectReactShim: false,
|
|
30
|
+
});
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
async function handler({ service = false }) {
|
package/lib/cli-commands/pack.js
CHANGED
|
@@ -1,58 +1,22 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
1
|
const { exit } = require('yargs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const { writeFile, readFile } = require('fs/promises');
|
|
5
2
|
const { exec, logInfo, logError, logSuccess } = require('./utils');
|
|
6
3
|
const { isTypeScriptEnabled } = require('../typescript/util');
|
|
7
4
|
const { esBuild } = require('../transpile/esbuild');
|
|
8
|
-
|
|
9
5
|
const { name } = require('../../package.json');
|
|
10
6
|
|
|
11
|
-
async
|
|
7
|
+
const compileTypeScript = async () => {
|
|
12
8
|
logInfo('Compiling typescript files...');
|
|
13
9
|
await exec('tsc');
|
|
14
|
-
|
|
15
|
-
}
|
|
10
|
+
};
|
|
16
11
|
|
|
17
|
-
async
|
|
12
|
+
const webBuild = async (productionBuild) => {
|
|
18
13
|
logInfo('Compiling source files for browser environment...');
|
|
19
14
|
const devCmd = `node_modules/${name}/lib/webpack/webpack.lib.dev.babel.js --color`;
|
|
20
15
|
const prodCmd = `node_modules/${name}/lib/webpack/webpack.lib.prod.babel.js --color`;
|
|
21
|
-
await exec(
|
|
22
|
-
|
|
23
|
-
productionBuild ? prodCmd : devCmd
|
|
24
|
-
}`,
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async function getSideEffects() {
|
|
29
|
-
const data = await readFile(path.join(process.cwd(), './package.json'));
|
|
30
|
-
const packageJSON = JSON.parse(data);
|
|
31
|
-
return packageJSON?.sideEffects || false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async function createPackageJson(file, commonJS, sideEffects) {
|
|
35
|
-
const packageJSON = JSON.stringify({
|
|
36
|
-
type: commonJS ? 'commonjs' : 'module',
|
|
37
|
-
sideEffects,
|
|
38
|
-
});
|
|
39
|
-
await writeFile(file, packageJSON);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async function nodeBuild({ srcPath, commonJS, emitModuleType }) {
|
|
43
|
-
const outDir = `./dist/${commonJS ? 'cjs' : 'es'}`;
|
|
44
|
-
await esBuild({ srcPath, commonJS });
|
|
45
|
-
if (emitModuleType) {
|
|
46
|
-
const sideEffects = await getSideEffects();
|
|
47
|
-
await createPackageJson(
|
|
48
|
-
path.join(process.cwd(), outDir, 'package.json'),
|
|
49
|
-
commonJS,
|
|
50
|
-
sideEffects,
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
16
|
+
await exec(`webpack --config ${productionBuild ? prodCmd : devCmd}`);
|
|
17
|
+
};
|
|
54
18
|
|
|
55
|
-
async
|
|
19
|
+
const pack = async ({ production, target, srcPath }) => {
|
|
56
20
|
logInfo('Build in-progress...');
|
|
57
21
|
await exec('rimraf ./dist');
|
|
58
22
|
if (isTypeScriptEnabled()) {
|
|
@@ -60,28 +24,12 @@ async function pack({ production, target, module, srcPath, emitModuleType }) {
|
|
|
60
24
|
}
|
|
61
25
|
if (target !== 'node') await webBuild(production);
|
|
62
26
|
if (target !== 'web') {
|
|
63
|
-
logInfo('
|
|
64
|
-
|
|
65
|
-
logInfo('output format: commonjs');
|
|
66
|
-
await nodeBuild({
|
|
67
|
-
srcPath,
|
|
68
|
-
commonJS: true,
|
|
69
|
-
emitModuleType,
|
|
70
|
-
target,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
if (module !== 'cjs') {
|
|
74
|
-
logInfo('output format: es');
|
|
75
|
-
await nodeBuild({
|
|
76
|
-
srcPath,
|
|
77
|
-
commonJS: false,
|
|
78
|
-
emitModuleType,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
27
|
+
logInfo('building source files for nodejs environment');
|
|
28
|
+
await esBuild({ srcdir: srcPath });
|
|
81
29
|
}
|
|
82
|
-
}
|
|
30
|
+
};
|
|
83
31
|
|
|
84
|
-
async
|
|
32
|
+
const handler = async (argv) => {
|
|
85
33
|
try {
|
|
86
34
|
await pack(argv);
|
|
87
35
|
logSuccess('Build completed');
|
|
@@ -89,7 +37,7 @@ async function handler(argv) {
|
|
|
89
37
|
logError('Build failed', err);
|
|
90
38
|
exit(-1, err);
|
|
91
39
|
}
|
|
92
|
-
}
|
|
40
|
+
};
|
|
93
41
|
|
|
94
42
|
exports.command = 'pack';
|
|
95
43
|
|
|
@@ -107,17 +55,6 @@ exports.builder = {
|
|
|
107
55
|
description:
|
|
108
56
|
'target environment where this library will be used. allowed values are web, node. by default libraries will be compiled for both web and nodejs environments',
|
|
109
57
|
},
|
|
110
|
-
module: {
|
|
111
|
-
type: 'string',
|
|
112
|
-
description:
|
|
113
|
-
'specify the format in which the library to be compiled. es - es module format, cjs - commonjs module format. by default libraries will be compiled in both es and cjs format ',
|
|
114
|
-
},
|
|
115
|
-
emitModuleType: {
|
|
116
|
-
type: 'boolean',
|
|
117
|
-
default: true,
|
|
118
|
-
description:
|
|
119
|
-
'creates type attribute in the package.json and sets its value to commonjs or module based on module cli argument. default: true',
|
|
120
|
-
},
|
|
121
58
|
srcPath: {
|
|
122
59
|
type: 'string',
|
|
123
60
|
default: './lib',
|
package/lib/transpile/esbuild.js
CHANGED
|
@@ -1,63 +1,108 @@
|
|
|
1
|
-
const
|
|
1
|
+
const { build } = require('esbuild');
|
|
2
2
|
const fg = require('fast-glob');
|
|
3
|
-
const
|
|
3
|
+
const { writeFile, copyFile, readFile } = require('fs/promises');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const
|
|
6
|
-
// const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
5
|
+
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
7
6
|
|
|
8
|
-
const
|
|
7
|
+
const TARGETS = {
|
|
8
|
+
browerslist: browserslistToEsbuild(),
|
|
9
|
+
web: 'es2020',
|
|
10
|
+
node: 'node14',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const ESBUILD_FORMAT = {
|
|
14
|
+
CJS: 'cjs',
|
|
15
|
+
ESM: 'esm',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const NODE_MODULE_TYPES = {
|
|
19
|
+
CJS: 'commonjs',
|
|
20
|
+
ESM: 'module',
|
|
21
|
+
};
|
|
9
22
|
|
|
10
|
-
const
|
|
23
|
+
const getCommonConfig = ({ injectReactShim }) => ({
|
|
11
24
|
bundle: false,
|
|
12
|
-
target: esBuild.target, // browserslistToEsbuild(),
|
|
13
25
|
loader: { '.js': 'jsx' },
|
|
14
26
|
mainFields: ['module', 'browser', 'main'],
|
|
15
|
-
inject: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
inject: [
|
|
28
|
+
injectReactShim ? path.resolve(__dirname, './react-shim.js') : '',
|
|
29
|
+
].filter(Boolean),
|
|
30
|
+
});
|
|
19
31
|
|
|
20
32
|
const copyFiles = async ({ srcdir, outdir }) => {
|
|
21
33
|
const files = await fg([
|
|
22
34
|
`${srcdir}/**/*.*`,
|
|
23
35
|
`!${srcdir}/**/*.{js,jsx,ts,tsx,cjs,mjs}`,
|
|
24
36
|
]);
|
|
25
|
-
files.forEach((srcFilePath) => {
|
|
37
|
+
files.forEach(async (srcFilePath) => {
|
|
26
38
|
const destFilePath = srcFilePath.replace(srcdir, outdir);
|
|
27
|
-
|
|
39
|
+
await copyFile(srcFilePath, destFilePath);
|
|
28
40
|
});
|
|
29
41
|
};
|
|
30
42
|
|
|
31
|
-
const
|
|
43
|
+
const getSideEffects = async () => {
|
|
44
|
+
const data = await readFile(path.join(process.cwd(), './package.json'));
|
|
45
|
+
const packageJSON = JSON.parse(data);
|
|
46
|
+
return packageJSON?.sideEffects || false;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const createPackageJson = async ({ outdir, type = NODE_MODULE_TYPES.ESM }) => {
|
|
50
|
+
const filePath = path.join(process.cwd(), outdir, 'package.json');
|
|
51
|
+
const packageJSON = JSON.stringify(
|
|
52
|
+
{
|
|
53
|
+
type,
|
|
54
|
+
sideEffects: await getSideEffects(),
|
|
55
|
+
},
|
|
56
|
+
null,
|
|
57
|
+
2,
|
|
58
|
+
);
|
|
59
|
+
await writeFile(filePath, packageJSON);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
exports.esBuild = async ({
|
|
63
|
+
srcdir,
|
|
64
|
+
outdir = 'dist',
|
|
65
|
+
esmOnly = false,
|
|
66
|
+
target = TARGETS.browerslist,
|
|
67
|
+
injectReactShim = true,
|
|
68
|
+
}) => {
|
|
32
69
|
const inputFiles = [
|
|
33
|
-
`${
|
|
34
|
-
`!${
|
|
35
|
-
`!${
|
|
36
|
-
`!${
|
|
70
|
+
`${srcdir}/**/*.{js,jsx,ts,tsx}`,
|
|
71
|
+
`!${srcdir}/**/*.test.{js,jsx,ts,tsx}`,
|
|
72
|
+
`!${srcdir}/**/*.stories.{js,jsx,ts,tsx}`,
|
|
73
|
+
`!${srcdir}/**/*.endpoint.{js,jsx,ts,tsx}`,
|
|
37
74
|
];
|
|
38
|
-
|
|
39
|
-
|
|
75
|
+
|
|
76
|
+
// build commonjs
|
|
77
|
+
if (!esmOnly) {
|
|
78
|
+
const cjsOutdir = `${outdir}/cjs`;
|
|
40
79
|
const commonJSEntryPoints = await fg(inputFiles);
|
|
41
|
-
await
|
|
80
|
+
await build({
|
|
42
81
|
entryPoints: commonJSEntryPoints,
|
|
43
|
-
...
|
|
44
|
-
outdir,
|
|
45
|
-
format:
|
|
82
|
+
...getCommonConfig({ injectReactShim }),
|
|
83
|
+
outdir: cjsOutdir,
|
|
84
|
+
format: ESBUILD_FORMAT.CJS,
|
|
85
|
+
target,
|
|
46
86
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const entryPoints = await fg(
|
|
51
|
-
inputFiles.concat([`!${srcPath}/**/cjs/**/*.{js,jsx,ts,tsx}`]),
|
|
52
|
-
);
|
|
53
|
-
await esbuild.build({
|
|
54
|
-
entryPoints,
|
|
55
|
-
...commonConfig,
|
|
56
|
-
outdir,
|
|
57
|
-
format: 'esm',
|
|
58
|
-
});
|
|
59
|
-
await copyFiles({ srcdir: srcPath, outdir });
|
|
87
|
+
// copy files that are not built by esbuild
|
|
88
|
+
await copyFiles({ srcdir, outdir: cjsOutdir });
|
|
89
|
+
await createPackageJson({ outdir: cjsOutdir, type: NODE_MODULE_TYPES.CJS });
|
|
60
90
|
}
|
|
61
|
-
};
|
|
62
91
|
|
|
63
|
-
|
|
92
|
+
// build esm
|
|
93
|
+
const esmOutdir = esmOnly ? outdir : `${outdir}/esm`;
|
|
94
|
+
const entryPoints = await fg(
|
|
95
|
+
inputFiles.concat([`!${srcdir}/**/cjs/**/*.{js,jsx,ts,tsx}`]),
|
|
96
|
+
);
|
|
97
|
+
await build({
|
|
98
|
+
entryPoints,
|
|
99
|
+
...getCommonConfig({ injectReactShim }),
|
|
100
|
+
outdir: esmOutdir,
|
|
101
|
+
format: ESBUILD_FORMAT.ESM,
|
|
102
|
+
target,
|
|
103
|
+
});
|
|
104
|
+
// copy files that are not built by esbuild
|
|
105
|
+
await copyFiles({ srcdir, outdir: esmOutdir });
|
|
106
|
+
await createPackageJson({ outdir: esmOutdir, type: NODE_MODULE_TYPES.ESM });
|
|
107
|
+
};
|
|
108
|
+
exports.TARGETS = TARGETS;
|
package/lib/webpack/helpers.js
CHANGED
|
@@ -218,6 +218,12 @@ const getCompressionPlugins = (isLibrary = false) => {
|
|
|
218
218
|
];
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
+
const filterByFilePresence = (patterns) =>
|
|
222
|
+
patterns.filter(
|
|
223
|
+
({ from, noErrorOnMissing }) =>
|
|
224
|
+
!noErrorOnMissing || fs.existsSync(path.resolve(process.cwd(), from)),
|
|
225
|
+
);
|
|
226
|
+
|
|
221
227
|
exports.excludeNodeModulesExcept = excludeNodeModulesExcept;
|
|
222
228
|
exports.getLibraryName = getLibraryName;
|
|
223
229
|
exports.getAppConfig = getAppConfig;
|
|
@@ -243,3 +249,4 @@ exports.resolveExtensions = [
|
|
|
243
249
|
exports.mainFields = ['browser', 'module', 'main'];
|
|
244
250
|
exports.isGoogleTagManagerEnabled = isGoogleTagManagerEnabled;
|
|
245
251
|
exports.getCompressionPlugins = getCompressionPlugins;
|
|
252
|
+
exports.filterByFilePresence = filterByFilePresence;
|
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
modulesToTranspile,
|
|
17
17
|
getAlias,
|
|
18
18
|
getPaths,
|
|
19
|
+
filterByFilePresence,
|
|
19
20
|
} = require('./helpers');
|
|
20
21
|
|
|
21
22
|
const minicssLoader = {
|
|
@@ -43,7 +44,7 @@ const plugins = [
|
|
|
43
44
|
React: 'react',
|
|
44
45
|
}),
|
|
45
46
|
new CopyWebpackPlugin({
|
|
46
|
-
patterns: [
|
|
47
|
+
patterns: filterByFilePresence([
|
|
47
48
|
{
|
|
48
49
|
from: 'app/app.config.json',
|
|
49
50
|
to: 'app.config.json',
|
|
@@ -87,13 +88,19 @@ const plugins = [
|
|
|
87
88
|
{
|
|
88
89
|
from: 'public',
|
|
89
90
|
noErrorOnMissing: true,
|
|
91
|
+
globOptions: {
|
|
92
|
+
ignore: ['readme.md'],
|
|
93
|
+
},
|
|
90
94
|
},
|
|
91
95
|
{
|
|
92
96
|
from: 'webroot',
|
|
93
97
|
to: '../',
|
|
94
98
|
noErrorOnMissing: true,
|
|
99
|
+
globOptions: {
|
|
100
|
+
ignore: ['readme.md'],
|
|
101
|
+
},
|
|
95
102
|
},
|
|
96
|
-
],
|
|
103
|
+
]),
|
|
97
104
|
}),
|
|
98
105
|
new DuplicatePackageCheckerPlugin(),
|
|
99
106
|
new MomentLocalesPlugin({ localesToKeep: ['es-us'] }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const
|
|
3
|
+
const { EnvironmentPlugin, DefinePlugin } = require('webpack');
|
|
4
4
|
const {
|
|
5
5
|
optimize: { LimitChunkCountPlugin },
|
|
6
6
|
ProgressPlugin,
|
|
@@ -10,6 +10,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
|
10
10
|
const PostcssPresetEnv = require('postcss-preset-env');
|
|
11
11
|
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
|
|
12
12
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
13
|
+
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
13
14
|
|
|
14
15
|
const {
|
|
15
16
|
excludeNodeModulesExcept,
|
|
@@ -18,9 +19,8 @@ const {
|
|
|
18
19
|
modulesToTranspile,
|
|
19
20
|
getAssetPath,
|
|
20
21
|
getAlias,
|
|
22
|
+
filterByFilePresence,
|
|
21
23
|
} = require('./helpers');
|
|
22
|
-
const { getPUIConfig } = require('../pui-config');
|
|
23
|
-
const { esBuild } = getPUIConfig();
|
|
24
24
|
|
|
25
25
|
const minicssLoader = {
|
|
26
26
|
loader: MiniCssExtractPlugin.loader,
|
|
@@ -31,26 +31,26 @@ const finalCSSLoader = (mode) =>
|
|
|
31
31
|
mode !== 'production' ? { loader: 'style-loader' } : minicssLoader;
|
|
32
32
|
|
|
33
33
|
const plugins = [
|
|
34
|
-
new
|
|
34
|
+
new EnvironmentPlugin({
|
|
35
35
|
NODE_ENV: 'development',
|
|
36
36
|
ASSET_PATH: '/',
|
|
37
37
|
CI: 'false',
|
|
38
38
|
}),
|
|
39
|
-
new
|
|
39
|
+
new DefinePlugin({
|
|
40
40
|
APP_CONFIG: getAppConfig(true),
|
|
41
41
|
}),
|
|
42
42
|
new CopyWebpackPlugin({
|
|
43
|
-
patterns: [
|
|
43
|
+
patterns: filterByFilePresence([
|
|
44
44
|
{
|
|
45
45
|
from: 'lib/app.config.json',
|
|
46
46
|
to: 'app.config.json',
|
|
47
47
|
noErrorOnMissing: true,
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
from: '
|
|
50
|
+
from: 'lib/public',
|
|
51
51
|
noErrorOnMissing: true,
|
|
52
52
|
},
|
|
53
|
-
],
|
|
53
|
+
]),
|
|
54
54
|
}),
|
|
55
55
|
new DuplicatePackageCheckerPlugin(),
|
|
56
56
|
new LimitChunkCountPlugin({
|
|
@@ -84,7 +84,7 @@ module.exports = (options) => ({
|
|
|
84
84
|
loader: 'esbuild-loader',
|
|
85
85
|
options: {
|
|
86
86
|
loader: 'jsx',
|
|
87
|
-
target:
|
|
87
|
+
target: browserslistToEsbuild(),
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
},
|
|
@@ -98,7 +98,7 @@ module.exports = (options) => ({
|
|
|
98
98
|
loader: 'esbuild-loader',
|
|
99
99
|
options: {
|
|
100
100
|
loader: 'tsx',
|
|
101
|
-
target:
|
|
101
|
+
target: browserslistToEsbuild(),
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
},
|
|
@@ -157,6 +157,7 @@ module.exports = (options) => ({
|
|
|
157
157
|
test: /\.svg$/i,
|
|
158
158
|
issuer: /\.[jt]sx?$/,
|
|
159
159
|
resourceQuery: /^((?!url).)*$/,
|
|
160
|
+
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
160
161
|
use: ['@svgr/webpack'],
|
|
161
162
|
},
|
|
162
163
|
{
|
|
@@ -177,10 +178,12 @@ module.exports = (options) => ({
|
|
|
177
178
|
{
|
|
178
179
|
resourceQuery: /resource/,
|
|
179
180
|
type: 'asset/resource',
|
|
181
|
+
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
180
182
|
},
|
|
181
183
|
{
|
|
182
184
|
type: 'asset',
|
|
183
185
|
resourceQuery: /url/,
|
|
186
|
+
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
184
187
|
},
|
|
185
188
|
],
|
|
186
189
|
},
|
|
@@ -35,7 +35,7 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
35
35
|
libraryName,
|
|
36
36
|
}),
|
|
37
37
|
new CircularDependencyPlugin({
|
|
38
|
-
exclude: /a\.js|node_modules/, // exclude node_modules
|
|
38
|
+
exclude: /a\.(js|ts|jsx|tsx)|node_modules/, // exclude node_modules
|
|
39
39
|
failOnError: false, // show a warning when there is a circular dependency
|
|
40
40
|
}),
|
|
41
41
|
new MiniCssExtractPlugin({
|
|
@@ -3,9 +3,8 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
3
3
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
4
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
5
5
|
const { ESBuildMinifyPlugin } = require('esbuild-loader');
|
|
6
|
+
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
6
7
|
const { getLibraryName, getCompressionPlugins } = require('./helpers');
|
|
7
|
-
const { getPUIConfig } = require('../pui-config');
|
|
8
|
-
const { esBuild } = getPUIConfig();
|
|
9
8
|
|
|
10
9
|
const libraryName = getLibraryName();
|
|
11
10
|
|
|
@@ -24,7 +23,7 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
24
23
|
minimize: true,
|
|
25
24
|
minimizer: [
|
|
26
25
|
new ESBuildMinifyPlugin({
|
|
27
|
-
target:
|
|
26
|
+
target: browserslistToEsbuild(),
|
|
28
27
|
css: true,
|
|
29
28
|
}),
|
|
30
29
|
],
|
|
@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
|
6
6
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
7
7
|
const { ESBuildMinifyPlugin } = require('esbuild-loader');
|
|
8
8
|
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
|
|
9
|
+
const browserslistToEsbuild = require('browserslist-to-esbuild');
|
|
9
10
|
|
|
10
11
|
const baseConfigFactory = require('./webpack.base.babel');
|
|
11
12
|
const {
|
|
@@ -17,8 +18,6 @@ const {
|
|
|
17
18
|
isGoogleTagManagerEnabled,
|
|
18
19
|
getCompressionPlugins,
|
|
19
20
|
} = require('./helpers');
|
|
20
|
-
const { getPUIConfig } = require('../pui-config');
|
|
21
|
-
const { esBuild } = getPUIConfig();
|
|
22
21
|
|
|
23
22
|
const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
24
23
|
const { buildPath, publicPath } = getPaths(latestVersion);
|
|
@@ -43,7 +42,7 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
43
42
|
moduleIds: 'deterministic',
|
|
44
43
|
minimizer: [
|
|
45
44
|
new ESBuildMinifyPlugin({
|
|
46
|
-
target:
|
|
45
|
+
target: browserslistToEsbuild(),
|
|
47
46
|
css: true,
|
|
48
47
|
}),
|
|
49
48
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.56",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "ICE MT UI Platform CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/cli": "~7.16.8",
|
|
51
|
-
"@babel/core": "~7.16.
|
|
51
|
+
"@babel/core": "~7.16.10",
|
|
52
52
|
"@babel/eslint-parser": "~7.16.5",
|
|
53
53
|
"@babel/node": "~7.16.8",
|
|
54
54
|
"@babel/plugin-proposal-class-properties": "~7.16.7",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"@babel/plugin-transform-react-constant-elements": "~7.16.7",
|
|
59
59
|
"@babel/plugin-transform-react-inline-elements": "~7.16.7",
|
|
60
60
|
"@babel/plugin-transform-react-jsx-source": "~7.16.7",
|
|
61
|
-
"@babel/plugin-transform-runtime": "~7.16.
|
|
62
|
-
"@babel/preset-env": "~7.16.
|
|
61
|
+
"@babel/plugin-transform-runtime": "~7.16.10",
|
|
62
|
+
"@babel/preset-env": "~7.16.11",
|
|
63
63
|
"@babel/preset-react": "~7.16.7",
|
|
64
64
|
"@babel/preset-typescript": "~7.16.7",
|
|
65
65
|
"@babel/runtime": "~7.16.7",
|
|
66
|
-
"@commitlint/cli": "~16.0
|
|
66
|
+
"@commitlint/cli": "~16.1.0",
|
|
67
67
|
"@commitlint/config-conventional": "~16.0.0",
|
|
68
|
-
"@elliemae/browserslist-config-elliemae": "~1.2.1",
|
|
68
|
+
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.2.1",
|
|
69
69
|
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.4",
|
|
70
70
|
"@semantic-release/changelog": "~6.0.1",
|
|
71
71
|
"@semantic-release/exec": "~6.0.3",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"@stylelint/postcss-css-in-js": "~0.37.2",
|
|
84
84
|
"@svgr/webpack": "~6.2.0",
|
|
85
85
|
"@swc/cli": "~0.1.55",
|
|
86
|
-
"@swc/core": "~1.2.
|
|
86
|
+
"@swc/core": "~1.2.133",
|
|
87
87
|
"@swc/jest": "~0.2.17",
|
|
88
88
|
"@testing-library/jest-dom": "~5.16.1",
|
|
89
89
|
"@testing-library/react": "~12.1.2",
|
|
90
90
|
"@testing-library/react-hooks": "~7.0.2",
|
|
91
91
|
"@types/jest": "~27.4.0",
|
|
92
|
-
"@types/node": "~17.0.
|
|
92
|
+
"@types/node": "~17.0.10",
|
|
93
93
|
"@types/rimraf": "~3.0.2",
|
|
94
94
|
"@types/testing-library__jest-dom": "~5.14.2",
|
|
95
95
|
"@typescript-eslint/eslint-plugin": "~5.10.0",
|
|
@@ -112,18 +112,16 @@
|
|
|
112
112
|
"browserslist": "~4.19.1",
|
|
113
113
|
"browserslist-to-esbuild": "~1.1.1",
|
|
114
114
|
"bundlesize": "~0.18.1",
|
|
115
|
-
"
|
|
115
|
+
"canvas": "~2.9.0",
|
|
116
116
|
"chalk": "~4.1.2",
|
|
117
117
|
"circular-dependency-plugin": "~5.2.2",
|
|
118
|
-
"classnames": "~2.3.1",
|
|
119
|
-
"compare-versions": "~4.1.3",
|
|
120
118
|
"compression": "~1.7.4",
|
|
121
119
|
"compression-webpack-plugin": "~9.2.0",
|
|
122
|
-
"copy-webpack-plugin": "~10.2.
|
|
120
|
+
"copy-webpack-plugin": "~10.2.1",
|
|
123
121
|
"cors": "~2.8.5",
|
|
124
122
|
"cross-env": "~7.0.3",
|
|
125
123
|
"css-loader": "~6.5.1",
|
|
126
|
-
"css-minimizer-webpack-plugin": "~3.
|
|
124
|
+
"css-minimizer-webpack-plugin": "~3.4.1",
|
|
127
125
|
"depcheck": "~1.4.3",
|
|
128
126
|
"docdash": "~1.2.0",
|
|
129
127
|
"dotenv": "~12.0.4",
|
|
@@ -131,7 +129,6 @@
|
|
|
131
129
|
"duplicate-package-checker-webpack-plugin": "~3.0.0",
|
|
132
130
|
"enhanced-resolve": "~5.8.3",
|
|
133
131
|
"esbuild": "~0.14.11",
|
|
134
|
-
"esbuild-jest": "~0.5.0",
|
|
135
132
|
"esbuild-loader": "~2.18.0",
|
|
136
133
|
"esbuild-plugin-svgr": "~1.0.0",
|
|
137
134
|
"eslint": "~8.7.0",
|
|
@@ -154,7 +151,7 @@
|
|
|
154
151
|
"eslint-plugin-react": "~7.28.0",
|
|
155
152
|
"eslint-plugin-react-hooks": "~4.3.0",
|
|
156
153
|
"eslint-plugin-redux-saga": "~1.3.2",
|
|
157
|
-
"eslint-plugin-storybook": "~0.5.
|
|
154
|
+
"eslint-plugin-storybook": "~0.5.6",
|
|
158
155
|
"eslint-plugin-testing-library": "~5.0.3",
|
|
159
156
|
"eslint-plugin-wdio": "~7.4.2",
|
|
160
157
|
"execa": "~5.1.1",
|
|
@@ -163,11 +160,8 @@
|
|
|
163
160
|
"express-static-gzip": "~2.1.1",
|
|
164
161
|
"favicons": "~6.2.2",
|
|
165
162
|
"favicons-webpack-plugin": "~5.0.2",
|
|
166
|
-
"
|
|
167
|
-
"fork-ts-checker-webpack-plugin": "~6.5.0",
|
|
168
|
-
"happy-dom": "~2.25.2",
|
|
163
|
+
"happy-dom": "~2.27.2",
|
|
169
164
|
"helmet-csp": "~3.4.0",
|
|
170
|
-
"html-loader": "~3.1.0",
|
|
171
165
|
"html-webpack-plugin": "~5.5.0",
|
|
172
166
|
"http-server": "~14.1.0",
|
|
173
167
|
"husky": "~7.0.4",
|
|
@@ -180,19 +174,19 @@
|
|
|
180
174
|
"jest-styled-components": "~7.0.8",
|
|
181
175
|
"jscodeshift": "~0.13.1",
|
|
182
176
|
"jsdoc": "~3.6.7",
|
|
183
|
-
"lint-staged": "~12.
|
|
177
|
+
"lint-staged": "~12.2.2",
|
|
184
178
|
"mini-css-extract-plugin": "~2.5.2",
|
|
185
179
|
"minimist": "~1.2.5",
|
|
186
180
|
"moment": "~2.29.1",
|
|
187
181
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
188
|
-
"msw": "~0.36.
|
|
182
|
+
"msw": "~0.36.5",
|
|
189
183
|
"node-gyp": "~8.4.1",
|
|
190
184
|
"node-plop": "~0.30.0",
|
|
191
185
|
"nodemon": "~2.0.15",
|
|
192
186
|
"npm-check-updates": "12.1.0",
|
|
193
187
|
"null-loader": "~4.0.1",
|
|
194
|
-
"pino": "~7.6.
|
|
195
|
-
"pino-pretty": "~7.
|
|
188
|
+
"pino": "~7.6.4",
|
|
189
|
+
"pino-pretty": "~7.5.0",
|
|
196
190
|
"pinst": "~2.1.6",
|
|
197
191
|
"plop": "~3.0.5",
|
|
198
192
|
"postcss": "~8.4.5",
|
|
@@ -206,7 +200,6 @@
|
|
|
206
200
|
"pug": "~3.0.2",
|
|
207
201
|
"pug-loader": "~2.4.0",
|
|
208
202
|
"raf": "~3.4.1",
|
|
209
|
-
"raw-loader": "~4.0.2",
|
|
210
203
|
"react-axe": "~3.5.4",
|
|
211
204
|
"react-docgen": "~5.4.0",
|
|
212
205
|
"react-refresh": "~0.11.0",
|
|
@@ -214,9 +207,7 @@
|
|
|
214
207
|
"resize-observer-polyfill": "~1.5.1",
|
|
215
208
|
"resolve-typescript-plugin": "~1.1.4",
|
|
216
209
|
"rimraf": "~3.0.2",
|
|
217
|
-
"
|
|
218
|
-
"semantic-release": "~18.0.1",
|
|
219
|
-
"shelljs": "~0.8.5",
|
|
210
|
+
"semantic-release": "~19.0.2",
|
|
220
211
|
"slackify-markdown": "~4.3.1",
|
|
221
212
|
"speed-measure-webpack-plugin": "~1.5.0",
|
|
222
213
|
"storybook-addon-turbo-build": "~1.0.1",
|
|
@@ -226,22 +217,16 @@
|
|
|
226
217
|
"stylelint": "~14.2.0",
|
|
227
218
|
"stylelint-config-recommended": "~6.0.0",
|
|
228
219
|
"stylelint-config-styled-components": "~0.1.1",
|
|
229
|
-
"svg-url-loader": "~7.1.1",
|
|
230
|
-
"svgo": "~2.8.0",
|
|
231
220
|
"swc-loader": "~0.1.15",
|
|
232
221
|
"terser-webpack-plugin": "~5.3.0",
|
|
233
222
|
"ts-node": "~10.4.0",
|
|
234
223
|
"tsc-alias": "~1.5.0",
|
|
235
|
-
"
|
|
236
|
-
"tsconfig-paths": "~3.12.0",
|
|
237
|
-
"tsconfig-paths-webpack-plugin": "~3.5.2",
|
|
238
|
-
"type-fest": "~2.9.0",
|
|
239
|
-
"typescript": "~4.5.4",
|
|
224
|
+
"typescript": "~4.5.5",
|
|
240
225
|
"update-notifier": "~5.1.0",
|
|
241
226
|
"url-loader": "~4.1.1",
|
|
242
227
|
"uuid": "~8.3.2",
|
|
243
|
-
"vite": "~2.7.
|
|
244
|
-
"vitest": "~0.1.
|
|
228
|
+
"vite": "~2.7.13",
|
|
229
|
+
"vitest": "~0.1.24",
|
|
245
230
|
"webpack": "~5.65.0",
|
|
246
231
|
"webpack-bundle-analyzer": "~4.5.0",
|
|
247
232
|
"webpack-cli": "~4.9.1",
|
|
@@ -249,8 +234,6 @@
|
|
|
249
234
|
"webpack-hot-middleware": "~2.25.1",
|
|
250
235
|
"webpack-manifest-plugin": "~4.1.1",
|
|
251
236
|
"webpack-merge": "~5.8.0",
|
|
252
|
-
"webpack-pwa-manifest": "~4.3.0",
|
|
253
|
-
"webpack-strip-block": "~0.3.0",
|
|
254
237
|
"whatwg-fetch": "~3.6.2",
|
|
255
238
|
"workbox-webpack-plugin": "~6.4.2",
|
|
256
239
|
"yargs": "~17.3.1"
|