@elliemae/pui-cli 5.17.2 → 6.0.0-beta.10
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/pack.js +4 -9
- package/lib/esbuild.js +44 -0
- package/lib/server/index.js +5 -2
- package/lib/testing/mocks/svg.js +5 -3
- package/lib/webpack/webpack.base.babel.js +54 -41
- package/lib/webpack/webpack.dev.babel.js +8 -0
- package/lib/webpack/webpack.lib.base.babel.js +13 -34
- package/lib/webpack/webpack.lib.prod.babel.js +5 -12
- package/lib/webpack/webpack.prod.babel.js +13 -14
- package/lib/webpack/webpack.storybook.js +13 -24
- package/package.json +41 -37
package/lib/cli-commands/pack.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
1
2
|
const { exit } = require('yargs');
|
|
2
3
|
const path = require('path');
|
|
3
4
|
const { writeFile, readFile } = require('fs/promises');
|
|
4
5
|
const { exec, logInfo, logError, logSuccess } = require('./utils');
|
|
5
6
|
const { isTypeScriptEnabled } = require('../typescript/util');
|
|
7
|
+
const { esBuild } = require('../esbuild');
|
|
6
8
|
|
|
7
9
|
const { name } = require('../../package.json');
|
|
8
10
|
|
|
@@ -37,14 +39,9 @@ async function createPackageJson(file, commonJS, sideEffects) {
|
|
|
37
39
|
await writeFile(file, packageJSON);
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
async function nodeBuild({ srcPath, commonJS, emitModuleType
|
|
42
|
+
async function nodeBuild({ srcPath, commonJS, emitModuleType }) {
|
|
41
43
|
const outDir = `./dist/${commonJS ? 'cjs' : 'es'}`;
|
|
42
|
-
|
|
43
|
-
const babelEnv = commonJS ? ' ES_MODULES=false' : '';
|
|
44
|
-
await exec(
|
|
45
|
-
`cross-env NODE_ENV=production MODULE_EXTENSIONS=true ${targetEnv}${babelEnv} babel --extensions ".ts,.tsx,.js,.jsx" ${srcPath} --out-dir ${outDir} --copy-files --no-copy-ignored --ignore **/*.test.js --ignore **/*.test.ts --ignore **/*.spec.js --ignore **/*.spec.ts --ignore **/*.test.jsx --ignore **/*.test.tsx --ignore **/*.spec.jsx --ignore **/*.spec.tsx`,
|
|
46
|
-
{ shell: true, stdio: 'inherit' },
|
|
47
|
-
);
|
|
44
|
+
await esBuild({ srcPath, commonJS });
|
|
48
45
|
if (emitModuleType) {
|
|
49
46
|
const sideEffects = await getSideEffects();
|
|
50
47
|
await createPackageJson(
|
|
@@ -79,7 +76,6 @@ async function pack({ production, target, module, srcPath, emitModuleType }) {
|
|
|
79
76
|
srcPath,
|
|
80
77
|
commonJS: false,
|
|
81
78
|
emitModuleType,
|
|
82
|
-
target,
|
|
83
79
|
});
|
|
84
80
|
}
|
|
85
81
|
}
|
|
@@ -118,7 +114,6 @@ exports.builder = {
|
|
|
118
114
|
},
|
|
119
115
|
emitModuleType: {
|
|
120
116
|
type: 'boolean',
|
|
121
|
-
// eslint-disable-next-line max-lines
|
|
122
117
|
default: true,
|
|
123
118
|
description:
|
|
124
119
|
'creates type attribute in the package.json and sets its value to commonjs or module based on module cli argument. default: true',
|
package/lib/esbuild.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const esbuild = require('esbuild');
|
|
2
|
+
const fg = require('fast-glob');
|
|
3
|
+
|
|
4
|
+
const ESBUILD_TARGET = 'es2020';
|
|
5
|
+
|
|
6
|
+
const commonConfig = {
|
|
7
|
+
bundle: false,
|
|
8
|
+
target: ESBUILD_TARGET,
|
|
9
|
+
loader: { '.js': 'jsx' },
|
|
10
|
+
mainFields: ['module', 'browser', 'main'],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const outDir = 'dist';
|
|
14
|
+
|
|
15
|
+
const build = async ({ srcPath, commonJS }) => {
|
|
16
|
+
const inputFiles = [
|
|
17
|
+
`${srcPath}/**/*.{js,jsx,ts,tsx}`,
|
|
18
|
+
`!${srcPath}/**/*.test.{js,jsx,ts,tsx}`,
|
|
19
|
+
`!${srcPath}/**/*.stories.{js,jsx,ts,tsx}`,
|
|
20
|
+
`!${srcPath}/**/*.endpoint.{js,jsx,ts,tsx}`,
|
|
21
|
+
];
|
|
22
|
+
if (!commonJS) {
|
|
23
|
+
const entryPoints = await fg(inputFiles);
|
|
24
|
+
await esbuild.build({
|
|
25
|
+
entryPoints,
|
|
26
|
+
...commonConfig,
|
|
27
|
+
outdir: `${outDir}/es`,
|
|
28
|
+
format: 'esm',
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
const commonJSEntryPoints = await fg(
|
|
32
|
+
inputFiles.concat([`${srcPath}/**/*.cjs`]),
|
|
33
|
+
);
|
|
34
|
+
await esbuild.build({
|
|
35
|
+
entryPoints: commonJSEntryPoints,
|
|
36
|
+
...commonConfig,
|
|
37
|
+
outdir: `${outDir}/cjs`,
|
|
38
|
+
format: 'cjs',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
exports.esBuild = build;
|
|
44
|
+
exports.ESBUILD_TARGET = ESBUILD_TARGET;
|
package/lib/server/index.js
CHANGED
|
@@ -13,8 +13,11 @@ const { loadRoutes } = require('./util');
|
|
|
13
13
|
const { getAssetPath } = require('../webpack/helpers');
|
|
14
14
|
|
|
15
15
|
const pino = expressPinoLogger({
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
transport: {
|
|
17
|
+
target: 'pino-pretty',
|
|
18
|
+
options: {
|
|
19
|
+
colorize: true,
|
|
20
|
+
},
|
|
18
21
|
},
|
|
19
22
|
});
|
|
20
23
|
pino.logger.level = 'warn';
|
package/lib/testing/mocks/svg.js
CHANGED
|
@@ -7,7 +7,7 @@ const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack
|
|
|
7
7
|
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
|
8
8
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
9
9
|
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
|
|
10
|
-
const
|
|
10
|
+
const { ProvidePlugin } = require('webpack');
|
|
11
11
|
|
|
12
12
|
const {
|
|
13
13
|
excludeNodeModulesExcept,
|
|
@@ -15,12 +15,10 @@ const {
|
|
|
15
15
|
modulesToTranspile,
|
|
16
16
|
getAlias,
|
|
17
17
|
getPaths,
|
|
18
|
-
getMediaPath,
|
|
19
18
|
} = require('./helpers');
|
|
20
|
-
const {
|
|
19
|
+
const { ESBUILD_TARGET } = require('../esbuild');
|
|
21
20
|
|
|
22
21
|
// get the application configuration
|
|
23
|
-
const devMode = process.env.NODE_ENV !== 'production';
|
|
24
22
|
const minicssLoader = {
|
|
25
23
|
loader: MiniCssExtractPlugin.loader,
|
|
26
24
|
options: {},
|
|
@@ -46,6 +44,10 @@ const plugins = [
|
|
|
46
44
|
APP_CONFIG: getAppConfig(),
|
|
47
45
|
}),
|
|
48
46
|
new CaseSensitivePathsPlugin(),
|
|
47
|
+
// new ESLintPlugin(),
|
|
48
|
+
new ProvidePlugin({
|
|
49
|
+
React: 'react',
|
|
50
|
+
}),
|
|
49
51
|
new CopyWebpackPlugin({
|
|
50
52
|
patterns: [
|
|
51
53
|
{
|
|
@@ -64,21 +66,29 @@ const plugins = [
|
|
|
64
66
|
{
|
|
65
67
|
from: 'node_modules/@elliemae/pui-user-monitoring/dist/public/js',
|
|
66
68
|
to: 'js',
|
|
69
|
+
toType: 'dir',
|
|
70
|
+
info: { minimized: true },
|
|
67
71
|
},
|
|
68
72
|
{
|
|
69
|
-
from: 'node_modules/@elliemae/pui-app-loader/dist/public/js
|
|
70
|
-
to: 'js
|
|
73
|
+
from: 'node_modules/@elliemae/pui-app-loader/dist/public/js',
|
|
74
|
+
to: 'js',
|
|
75
|
+
toType: 'dir',
|
|
71
76
|
noErrorOnMissing: true,
|
|
77
|
+
info: { minimized: true },
|
|
72
78
|
},
|
|
73
79
|
{
|
|
74
|
-
from: 'node_modules/@elliemae/encw-loader/dist/public/js
|
|
75
|
-
to: 'js
|
|
80
|
+
from: 'node_modules/@elliemae/encw-loader/dist/public/js',
|
|
81
|
+
to: 'js',
|
|
82
|
+
toType: 'dir',
|
|
76
83
|
noErrorOnMissing: true,
|
|
84
|
+
info: { minimized: true },
|
|
77
85
|
},
|
|
78
86
|
{
|
|
79
|
-
from: 'node_modules/@elliemae/pui-diagnostics/dist/public/js
|
|
80
|
-
to: 'js
|
|
87
|
+
from: 'node_modules/@elliemae/pui-diagnostics/dist/public/js',
|
|
88
|
+
to: 'js',
|
|
89
|
+
toType: 'dir',
|
|
81
90
|
noErrorOnMissing: true,
|
|
91
|
+
info: { minimized: true },
|
|
82
92
|
},
|
|
83
93
|
{
|
|
84
94
|
from: 'public',
|
|
@@ -96,17 +106,6 @@ const plugins = [
|
|
|
96
106
|
new WebpackManifestPlugin(),
|
|
97
107
|
];
|
|
98
108
|
|
|
99
|
-
if (isTypeScriptEnabled()) {
|
|
100
|
-
plugins.push(
|
|
101
|
-
new ForkTsCheckerWebpackPlugin({
|
|
102
|
-
async: devMode,
|
|
103
|
-
eslint: {
|
|
104
|
-
files: './app/**/*.{ts,js,tsx,jsx}',
|
|
105
|
-
},
|
|
106
|
-
}),
|
|
107
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
109
|
module.exports = (options) => ({
|
|
111
110
|
mode: options.mode,
|
|
112
111
|
entry: options.entry,
|
|
@@ -121,7 +120,7 @@ module.exports = (options) => ({
|
|
|
121
120
|
module: {
|
|
122
121
|
rules: [
|
|
123
122
|
{
|
|
124
|
-
test: /\.(jpe?g|png|gif|svg)$/,
|
|
123
|
+
test: /\.(jpe?g|png|gif|svg|ico)$/,
|
|
125
124
|
use: [
|
|
126
125
|
'file-loader',
|
|
127
126
|
{
|
|
@@ -153,17 +152,30 @@ module.exports = (options) => ({
|
|
|
153
152
|
],
|
|
154
153
|
},
|
|
155
154
|
{
|
|
156
|
-
test: /\.(js|
|
|
155
|
+
test: /\.(js|jsx)$/,
|
|
157
156
|
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
158
157
|
resolve: {
|
|
159
158
|
fullySpecified: false,
|
|
160
159
|
},
|
|
161
160
|
use: {
|
|
162
|
-
loader: '
|
|
161
|
+
loader: 'esbuild-loader',
|
|
163
162
|
options: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
loader: 'jsx',
|
|
164
|
+
target: ESBUILD_TARGET,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
test: /\.(ts|tsx)$/,
|
|
170
|
+
exclude: excludeNodeModulesExcept(modulesToTranspile),
|
|
171
|
+
resolve: {
|
|
172
|
+
fullySpecified: false,
|
|
173
|
+
},
|
|
174
|
+
use: {
|
|
175
|
+
loader: 'esbuild-loader',
|
|
176
|
+
options: {
|
|
177
|
+
loader: 'tsx',
|
|
178
|
+
target: ESBUILD_TARGET,
|
|
167
179
|
},
|
|
168
180
|
},
|
|
169
181
|
},
|
|
@@ -178,6 +190,13 @@ module.exports = (options) => ({
|
|
|
178
190
|
sourceMap: true,
|
|
179
191
|
},
|
|
180
192
|
},
|
|
193
|
+
{
|
|
194
|
+
loader: 'esbuild-loader',
|
|
195
|
+
options: {
|
|
196
|
+
loader: 'css',
|
|
197
|
+
minify: options.mode === 'production',
|
|
198
|
+
},
|
|
199
|
+
},
|
|
181
200
|
{
|
|
182
201
|
loader: 'postcss-loader',
|
|
183
202
|
options: {
|
|
@@ -195,22 +214,16 @@ module.exports = (options) => ({
|
|
|
195
214
|
type: 'asset/resource',
|
|
196
215
|
},
|
|
197
216
|
{
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
loader: 'file-loader',
|
|
206
|
-
options: {
|
|
207
|
-
name: getMediaPath(),
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
],
|
|
217
|
+
type: 'asset',
|
|
218
|
+
resourceQuery: /url/, // *.svg?react
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
test: /\.svg$/i,
|
|
222
|
+
issuer: /\.[jt]sx?$/,
|
|
223
|
+
use: ['@svgr/webpack'],
|
|
211
224
|
},
|
|
212
225
|
{
|
|
213
|
-
test: /\.(jpe?g|png|gif)$/i,
|
|
226
|
+
test: /\.(jpe?g|png|gif|ico)$/i,
|
|
214
227
|
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
215
228
|
type: 'asset',
|
|
216
229
|
},
|
|
@@ -26,6 +26,14 @@ const {
|
|
|
26
26
|
const devConfig = {
|
|
27
27
|
mode: 'development',
|
|
28
28
|
|
|
29
|
+
cache: {
|
|
30
|
+
type: 'filesystem',
|
|
31
|
+
allowCollectingMemory: true,
|
|
32
|
+
buildDependencies: {
|
|
33
|
+
config: [__filename],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
|
|
29
37
|
// Add hot reloading in development
|
|
30
38
|
entry: {
|
|
31
39
|
app: [
|
|
@@ -10,7 +10,6 @@ const PostcssPresetEnv = require('postcss-preset-env');
|
|
|
10
10
|
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
|
|
11
11
|
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
|
12
12
|
const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
|
|
13
|
-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
14
13
|
|
|
15
14
|
const {
|
|
16
15
|
excludeNodeModulesExcept,
|
|
@@ -19,11 +18,9 @@ const {
|
|
|
19
18
|
modulesToTranspile,
|
|
20
19
|
getAssetPath,
|
|
21
20
|
getAlias,
|
|
22
|
-
getMediaPath,
|
|
23
21
|
} = require('./helpers');
|
|
24
|
-
const {
|
|
22
|
+
const { ESBUILD_TARGET } = require('../esbuild');
|
|
25
23
|
|
|
26
|
-
const devMode = process.env.NODE_ENV !== 'production';
|
|
27
24
|
const minicssLoader = {
|
|
28
25
|
loader: MiniCssExtractPlugin.loader,
|
|
29
26
|
options: {},
|
|
@@ -62,17 +59,6 @@ const plugins = [
|
|
|
62
59
|
new MomentLocalesPlugin(),
|
|
63
60
|
];
|
|
64
61
|
|
|
65
|
-
if (isTypeScriptEnabled()) {
|
|
66
|
-
plugins.push(
|
|
67
|
-
new ForkTsCheckerWebpackPlugin({
|
|
68
|
-
async: devMode,
|
|
69
|
-
eslint: {
|
|
70
|
-
files: './lib/**/*.{ts,js,tsx,jsx}',
|
|
71
|
-
},
|
|
72
|
-
}),
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
62
|
module.exports = (options) => ({
|
|
77
63
|
mode: options.mode,
|
|
78
64
|
entry: [path.join(process.cwd(), 'lib/index')],
|
|
@@ -88,7 +74,7 @@ module.exports = (options) => ({
|
|
|
88
74
|
module: {
|
|
89
75
|
rules: [
|
|
90
76
|
{
|
|
91
|
-
test: /\.(jpe?g|png|gif|svg)$/,
|
|
77
|
+
test: /\.(jpe?g|png|gif|svg|ico)$/,
|
|
92
78
|
use: [
|
|
93
79
|
'file-loader',
|
|
94
80
|
{
|
|
@@ -126,11 +112,10 @@ module.exports = (options) => ({
|
|
|
126
112
|
fullySpecified: false,
|
|
127
113
|
},
|
|
128
114
|
use: {
|
|
129
|
-
loader: '
|
|
115
|
+
loader: 'esbuild-loader',
|
|
130
116
|
options: {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
...(options.babelQuery || {}),
|
|
117
|
+
loader: 'jsx',
|
|
118
|
+
target: ESBUILD_TARGET,
|
|
134
119
|
},
|
|
135
120
|
},
|
|
136
121
|
},
|
|
@@ -186,22 +171,16 @@ module.exports = (options) => ({
|
|
|
186
171
|
type: 'asset/resource',
|
|
187
172
|
},
|
|
188
173
|
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
loader: 'file-loader',
|
|
197
|
-
options: {
|
|
198
|
-
name: getMediaPath(),
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
],
|
|
174
|
+
type: 'asset',
|
|
175
|
+
resourceQuery: /url/, // *.svg?react
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
test: /\.svg$/i,
|
|
179
|
+
issuer: /\.[jt]sx?$/,
|
|
180
|
+
use: ['@svgr/webpack'],
|
|
202
181
|
},
|
|
203
182
|
{
|
|
204
|
-
test: /\.(jpe?g|png|gif)$/i,
|
|
183
|
+
test: /\.(jpe?g|png|gif|ico)$/i,
|
|
205
184
|
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
206
185
|
type: 'asset',
|
|
207
186
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
3
2
|
const CompressionPlugin = require('compression-webpack-plugin');
|
|
4
3
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
4
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
6
|
-
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
7
5
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
6
|
+
const { ESBuildMinifyPlugin } = require('esbuild-loader');
|
|
8
7
|
const { getLibraryName } = require('./helpers');
|
|
8
|
+
const { ESBUILD_TARGET } = require('../esbuild');
|
|
9
9
|
|
|
10
10
|
const libraryName = getLibraryName();
|
|
11
11
|
|
|
@@ -23,17 +23,10 @@ module.exports = require('./webpack.lib.base.babel')({
|
|
|
23
23
|
moduleIds: 'deterministic',
|
|
24
24
|
minimize: true,
|
|
25
25
|
minimizer: [
|
|
26
|
-
new
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
comparisons: false,
|
|
30
|
-
},
|
|
31
|
-
format: {
|
|
32
|
-
comments: false,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
26
|
+
new ESBuildMinifyPlugin({
|
|
27
|
+
target: ESBUILD_TARGET,
|
|
28
|
+
css: true,
|
|
35
29
|
}),
|
|
36
|
-
new CssMinimizerPlugin(),
|
|
37
30
|
],
|
|
38
31
|
nodeEnv: 'production',
|
|
39
32
|
sideEffects: true,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
/* eslint-disable max-lines */
|
|
1
2
|
const path = require('path');
|
|
2
3
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
3
4
|
const { GenerateSW } = require('workbox-webpack-plugin');
|
|
4
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
5
5
|
const CompressionPlugin = require('compression-webpack-plugin');
|
|
6
6
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
7
|
-
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
8
7
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
8
|
+
const { ESBuildMinifyPlugin } = require('esbuild-loader');
|
|
9
9
|
|
|
10
10
|
const baseConfigFactory = require('./webpack.base.babel');
|
|
11
11
|
const {
|
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
getAppVersion,
|
|
17
17
|
isGoogleTagManagerEnabled,
|
|
18
18
|
} = require('./helpers');
|
|
19
|
+
const { ESBUILD_TARGET } = require('../esbuild');
|
|
19
20
|
|
|
20
21
|
const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
21
22
|
const { buildPath, publicPath } = getPaths(latestVersion);
|
|
@@ -39,17 +40,10 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
39
40
|
optimization: {
|
|
40
41
|
moduleIds: 'deterministic',
|
|
41
42
|
minimizer: [
|
|
42
|
-
new
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
comparisons: false,
|
|
46
|
-
},
|
|
47
|
-
format: {
|
|
48
|
-
comments: false,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
43
|
+
new ESBuildMinifyPlugin({
|
|
44
|
+
target: ESBUILD_TARGET,
|
|
45
|
+
css: true,
|
|
51
46
|
}),
|
|
52
|
-
new CssMinimizerPlugin(),
|
|
53
47
|
],
|
|
54
48
|
runtimeChunk: true,
|
|
55
49
|
splitChunks: {
|
|
@@ -78,7 +72,13 @@ const getProdConfig = ({ latestVersion = true } = {}) => {
|
|
|
78
72
|
filename: '[path][base].gz',
|
|
79
73
|
algorithm: 'gzip',
|
|
80
74
|
test: /\.js$|\.css$$/,
|
|
81
|
-
exclude: [
|
|
75
|
+
exclude: [
|
|
76
|
+
/\/adrum-ext/,
|
|
77
|
+
/\/emuiUserMonitoring/,
|
|
78
|
+
/\/emuiDiagnostics/,
|
|
79
|
+
/\/emuiAppLoader/,
|
|
80
|
+
/\/encwLoader/,
|
|
81
|
+
],
|
|
82
82
|
// we are compressing all files since in aws cloudfront edge lambda, we don't want to whitelist files that are not compressed due to below limits
|
|
83
83
|
minRatio: Number.MAX_SAFE_INTEGER,
|
|
84
84
|
}),
|
|
@@ -120,7 +120,6 @@ const htmlWebpackPlugin = new HtmlWebpackPlugin({
|
|
|
120
120
|
? 'app/index.html'
|
|
121
121
|
: 'app/index-app-loader.html',
|
|
122
122
|
minify: {
|
|
123
|
-
// eslint-disable-next-line max-lines
|
|
124
123
|
removeComments: true,
|
|
125
124
|
collapseWhitespace: true,
|
|
126
125
|
removeRedundantAttributes: true,
|
|
@@ -3,17 +3,14 @@ const webpack = require('webpack');
|
|
|
3
3
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
4
4
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
|
5
5
|
const CompressionPlugin = require('compression-webpack-plugin');
|
|
6
|
-
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
|
7
6
|
const {
|
|
8
7
|
getAppConfig,
|
|
9
8
|
isApp,
|
|
10
9
|
getAlias,
|
|
11
10
|
excludeNodeModulesExcept,
|
|
12
11
|
modulesToTranspile,
|
|
13
|
-
resolveExtensions,
|
|
14
|
-
mainFields,
|
|
15
|
-
getMediaPath,
|
|
16
12
|
} = require('./helpers');
|
|
13
|
+
const { ESBUILD_TARGET } = require('../esbuild');
|
|
17
14
|
|
|
18
15
|
const IS_APP = isApp();
|
|
19
16
|
const CWD = process.cwd();
|
|
@@ -60,7 +57,7 @@ const compressionPlugin = new CompressionPlugin({
|
|
|
60
57
|
|
|
61
58
|
const getModulePreRules = () => [
|
|
62
59
|
{
|
|
63
|
-
test: /\.(jpe?g|png|gif|svg)$/,
|
|
60
|
+
test: /\.(jpe?g|png|gif|svg|ico)$/,
|
|
64
61
|
use: [
|
|
65
62
|
'file-loader',
|
|
66
63
|
{
|
|
@@ -101,9 +98,10 @@ const getModuleRules = () => [
|
|
|
101
98
|
fullySpecified: false,
|
|
102
99
|
},
|
|
103
100
|
use: {
|
|
104
|
-
loader: '
|
|
101
|
+
loader: 'esbuild-loader',
|
|
105
102
|
options: {
|
|
106
|
-
|
|
103
|
+
loader: 'jsx',
|
|
104
|
+
target: ESBUILD_TARGET,
|
|
107
105
|
},
|
|
108
106
|
},
|
|
109
107
|
},
|
|
@@ -113,22 +111,16 @@ const getModuleRules = () => [
|
|
|
113
111
|
type: 'asset/resource',
|
|
114
112
|
},
|
|
115
113
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
loader: 'file-loader',
|
|
124
|
-
options: {
|
|
125
|
-
name: getMediaPath(),
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
],
|
|
114
|
+
type: 'asset',
|
|
115
|
+
resourceQuery: /url/, // *.svg?react
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
test: /\.svg$/i,
|
|
119
|
+
issuer: /\.[jt]sx?$/,
|
|
120
|
+
use: ['@svgr/webpack'],
|
|
129
121
|
},
|
|
130
122
|
{
|
|
131
|
-
test: /\.(jpe?g|png|gif)$/i,
|
|
123
|
+
test: /\.(jpe?g|png|gif|ico)$/i,
|
|
132
124
|
exclude: excludeNodeModulesExcept(['@elliemae/*']),
|
|
133
125
|
type: 'asset',
|
|
134
126
|
},
|
|
@@ -155,9 +147,6 @@ exports.webpackFinal = async (config, { configType }) => {
|
|
|
155
147
|
|
|
156
148
|
config.resolve.alias = { ...config.resolve.alias, ...getAlias() };
|
|
157
149
|
config.resolve.fallback = { ...config.resolve.fallback, crypto: false };
|
|
158
|
-
config.resolve.plugins = (config.resolve.plugins || []).concat([
|
|
159
|
-
new TsconfigPathsPlugin({ extensions: resolveExtensions, mainFields }),
|
|
160
|
-
]);
|
|
161
150
|
|
|
162
151
|
config.externals = config.externals || {};
|
|
163
152
|
config.externals['@elliemae/pui-user-monitoring'] = 'emuiUserMonitoring';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-beta.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "EllieMae Platform UI CLI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -66,38 +66,36 @@
|
|
|
66
66
|
"@commitlint/cli": "~15.0.0",
|
|
67
67
|
"@commitlint/config-conventional": "~15.0.0",
|
|
68
68
|
"@elliemae/browserslist-config-elliemae": "~1.2.1",
|
|
69
|
-
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.
|
|
69
|
+
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.3",
|
|
70
70
|
"@semantic-release/changelog": "~6.0.1",
|
|
71
71
|
"@semantic-release/exec": "~6.0.2",
|
|
72
72
|
"@semantic-release/git": "~10.0.1",
|
|
73
|
-
"@storybook/addon-a11y": "~6.
|
|
74
|
-
"@storybook/addon-actions": "~6.
|
|
75
|
-
"@storybook/addon-backgrounds": "~6.
|
|
76
|
-
"@storybook/addon-
|
|
77
|
-
"@storybook/addon-
|
|
78
|
-
"@storybook/addon-docs": "~6.3.12",
|
|
73
|
+
"@storybook/addon-a11y": "~6.4.0",
|
|
74
|
+
"@storybook/addon-actions": "~6.4.0",
|
|
75
|
+
"@storybook/addon-backgrounds": "~6.4.0",
|
|
76
|
+
"@storybook/addon-controls": "~6.4.0",
|
|
77
|
+
"@storybook/addon-docs": "~6.4.0",
|
|
79
78
|
"@storybook/addon-events": "~6.2.9",
|
|
80
|
-
"@storybook/addon-
|
|
81
|
-
"@storybook/addon-
|
|
82
|
-
"@storybook/addon-
|
|
83
|
-
"@storybook/addon-
|
|
84
|
-
"@storybook/
|
|
85
|
-
"@storybook/
|
|
86
|
-
"@storybook/
|
|
87
|
-
"@storybook/
|
|
88
|
-
"@storybook/
|
|
89
|
-
"@storybook/theming": "~6.3.12",
|
|
79
|
+
"@storybook/addon-links": "~6.4.0",
|
|
80
|
+
"@storybook/addon-storysource": "~6.4.0",
|
|
81
|
+
"@storybook/addon-toolbars": "~6.4.0",
|
|
82
|
+
"@storybook/addon-viewport": "~6.4.0",
|
|
83
|
+
"@storybook/addons": "~6.4.0",
|
|
84
|
+
"@storybook/builder-webpack5": "~6.4.0",
|
|
85
|
+
"@storybook/manager-webpack5": "~6.4.0",
|
|
86
|
+
"@storybook/react": "~6.4.0",
|
|
87
|
+
"@storybook/theming": "~6.4.0",
|
|
90
88
|
"@stylelint/postcss-css-in-js": "~0.37.2",
|
|
91
|
-
"@svgr/webpack": "~
|
|
89
|
+
"@svgr/webpack": "~6.0.0",
|
|
92
90
|
"@testing-library/jest-dom": "~5.15.1",
|
|
93
91
|
"@testing-library/react": "~12.1.2",
|
|
94
92
|
"@testing-library/react-hooks": "~7.0.2",
|
|
95
93
|
"@types/jest": "~27.0.3",
|
|
96
|
-
"@types/node": "~16.11.
|
|
94
|
+
"@types/node": "~16.11.10",
|
|
97
95
|
"@types/rimraf": "~3.0.2",
|
|
98
96
|
"@types/testing-library__jest-dom": "~5.14.1",
|
|
99
|
-
"@typescript-eslint/eslint-plugin": "~5.
|
|
100
|
-
"@typescript-eslint/parser": "~5.
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "~5.5.0",
|
|
98
|
+
"@typescript-eslint/parser": "~5.5.0",
|
|
101
99
|
"autoprefixer": "~10.4.0",
|
|
102
100
|
"axe-core": "~4.3.5",
|
|
103
101
|
"babel-loader": "~8.2.3",
|
|
@@ -107,7 +105,8 @@
|
|
|
107
105
|
"babel-plugin-import-remove-resource-query": "~1.0.0",
|
|
108
106
|
"babel-plugin-lodash": "~3.3.4",
|
|
109
107
|
"babel-plugin-module-resolver": "~4.1.0",
|
|
110
|
-
"babel-plugin-
|
|
108
|
+
"babel-plugin-source-map-support": "~2.1.3",
|
|
109
|
+
"babel-plugin-styled-components": "~2.0.2",
|
|
111
110
|
"babel-plugin-transform-react-remove-prop-types": "~0.4.24",
|
|
112
111
|
"babel-plugin-transform-remove-console": "~6.9.4",
|
|
113
112
|
"babel-plugin-transform-strip-block": "~0.0.4",
|
|
@@ -125,12 +124,15 @@
|
|
|
125
124
|
"cors": "~2.8.5",
|
|
126
125
|
"cross-env": "~7.0.3",
|
|
127
126
|
"css-loader": "~6.5.1",
|
|
128
|
-
"css-minimizer-webpack-plugin": "~3.
|
|
127
|
+
"css-minimizer-webpack-plugin": "~3.2.0",
|
|
129
128
|
"depcheck": "~1.4.2",
|
|
130
129
|
"docdash": "~1.2.0",
|
|
131
130
|
"dotenv": "~10.0.0",
|
|
132
131
|
"dotenv-webpack": "~7.0.3",
|
|
133
132
|
"duplicate-package-checker-webpack-plugin": "~3.0.0",
|
|
133
|
+
"esbuild": "~0.14.0",
|
|
134
|
+
"esbuild-jest": "~0.5.0",
|
|
135
|
+
"esbuild-loader": "~2.16.0",
|
|
134
136
|
"eslint": "~8.3.0",
|
|
135
137
|
"eslint-config-airbnb": "~18.2.1",
|
|
136
138
|
"eslint-config-airbnb-base": "~15.0.0",
|
|
@@ -157,7 +159,7 @@
|
|
|
157
159
|
"express": "~4.17.1",
|
|
158
160
|
"express-pino-logger": "~7.0.0",
|
|
159
161
|
"file-loader": "~6.2.0",
|
|
160
|
-
"fork-ts-checker-webpack-plugin": "~6.
|
|
162
|
+
"fork-ts-checker-webpack-plugin": "~6.5.0",
|
|
161
163
|
"helmet-csp": "~3.4.0",
|
|
162
164
|
"html-loader": "~3.0.1",
|
|
163
165
|
"html-webpack-plugin": "~5.5.0",
|
|
@@ -168,7 +170,7 @@
|
|
|
168
170
|
"imports-loader": "~3.1.1",
|
|
169
171
|
"ip": "~1.1.5",
|
|
170
172
|
"jest-axe": "~5.0.1",
|
|
171
|
-
"jest-cli": "~27.
|
|
173
|
+
"jest-cli": "~27.4.0",
|
|
172
174
|
"jest-sonar-reporter": "~2.0.0",
|
|
173
175
|
"jest-styled-components": "~7.0.8",
|
|
174
176
|
"jscodeshift": "~0.13.0",
|
|
@@ -179,22 +181,22 @@
|
|
|
179
181
|
"moment": "~2.29.1",
|
|
180
182
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
181
183
|
"msw": "~0.35.0",
|
|
182
|
-
"node-plop": "~0.
|
|
184
|
+
"node-plop": "~0.30.0",
|
|
183
185
|
"nodemon": "~2.0.15",
|
|
184
186
|
"npm-check-updates": "12.0.2",
|
|
185
187
|
"null-loader": "~4.0.1",
|
|
186
|
-
"pino": "~7.
|
|
188
|
+
"pino": "~7.5.0",
|
|
187
189
|
"pino-pretty": "~7.2.0",
|
|
188
190
|
"pinst": "~2.1.6",
|
|
189
|
-
"plop": "~
|
|
190
|
-
"postcss": "~8.
|
|
191
|
+
"plop": "~3.0.1",
|
|
192
|
+
"postcss": "~8.4.4",
|
|
191
193
|
"postcss-jsx": "~0.36.4",
|
|
192
|
-
"postcss-html": "~1.
|
|
193
|
-
"postcss-markdown": "~1.
|
|
194
|
+
"postcss-html": "~1.3.0",
|
|
195
|
+
"postcss-markdown": "~1.2.0",
|
|
194
196
|
"postcss-syntax": "~0.36.2",
|
|
195
|
-
"postcss-loader": "~6.2.
|
|
197
|
+
"postcss-loader": "~6.2.1",
|
|
196
198
|
"postcss-preset-env": "~7.0.1",
|
|
197
|
-
"prettier": "~2.
|
|
199
|
+
"prettier": "~2.5.0",
|
|
198
200
|
"pug": "~3.0.2",
|
|
199
201
|
"pug-loader": "~2.4.0",
|
|
200
202
|
"raf": "~3.4.1",
|
|
@@ -206,10 +208,11 @@
|
|
|
206
208
|
"resize-observer-polyfill": "~1.5.1",
|
|
207
209
|
"rimraf": "~3.0.2",
|
|
208
210
|
"script-loader": "~0.7.2",
|
|
209
|
-
"semantic-release": "~18.0.
|
|
211
|
+
"semantic-release": "~18.0.1",
|
|
210
212
|
"shelljs": "~0.8.4",
|
|
211
213
|
"slackify-markdown": "~4.3.0",
|
|
212
|
-
"storybook-
|
|
214
|
+
"storybook-builder-vite": "~0.1.10",
|
|
215
|
+
"storybook-addon-turbo-build": "~1.0.1",
|
|
213
216
|
"style-loader": "~3.3.1",
|
|
214
217
|
"stylelint": "~14.1.0",
|
|
215
218
|
"stylelint-config-recommended": "~6.0.0",
|
|
@@ -229,7 +232,8 @@
|
|
|
229
232
|
"update-notifier": "~5.1.0",
|
|
230
233
|
"url-loader": "~4.1.1",
|
|
231
234
|
"uuid": "~8.3.2",
|
|
232
|
-
"
|
|
235
|
+
"vite": "~2.6.14",
|
|
236
|
+
"webpack": "~5.64.4",
|
|
233
237
|
"webpack-bundle-analyzer": "~4.5.0",
|
|
234
238
|
"webpack-cli": "~4.9.1",
|
|
235
239
|
"webpack-dev-middleware": "~5.2.2",
|