@elliemae/pui-cli 6.0.0-beta.17 → 6.0.0-beta.18

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/esbuild.js CHANGED
@@ -9,6 +9,17 @@ const commonConfig = {
9
9
  target: ESBUILD_TARGET,
10
10
  loader: { '.js': 'jsx' },
11
11
  mainFields: ['module', 'browser', 'main'],
12
+ plugins: [
13
+ {
14
+ name: 'extension',
15
+ setup(build) {
16
+ // eslint-disable-next-line consistent-return
17
+ build.onResolve({ filter: /.*/ }, (args) => {
18
+ if (args.importer) return { path: `${args.path}.js`, external: true };
19
+ });
20
+ },
21
+ },
22
+ ],
12
23
  };
13
24
 
14
25
  const distFolder = 'dist';
@@ -60,21 +60,6 @@ const customHost = argv.host || process.env.HOST;
60
60
  const host = customHost || null; // Let http.Server use its default IPv6/4 host
61
61
  const prettyHost = customHost || 'localhost';
62
62
 
63
- const serveCompressedAssets = (req, res, next) => {
64
- if (req.header('Accept-Encoding').includes('br')) {
65
- req.url += '.br';
66
- res.set('Content-Encoding', 'br');
67
- } else {
68
- req.url += '.gz';
69
- res.set('Content-Encoding', 'gzip');
70
- }
71
- next();
72
- };
73
-
74
- // use the compressed bundle
75
- app.get('*.js', serveCompressedAssets);
76
- app.get('*.css', serveCompressedAssets);
77
-
78
63
  // Start your app.
79
64
  app.listen(port, host, async (err) => {
80
65
  if (err) {
@@ -1,5 +1,5 @@
1
1
  const webpack = require('webpack');
2
- const express = require('express');
2
+ const expressStaticGzip = require('express-static-gzip');
3
3
  const webpackDevMiddleware = require('webpack-dev-middleware');
4
4
  const webpackHotMiddleware = require('webpack-hot-middleware');
5
5
  const { sendFileWithCSPNonce } = require('../csp');
@@ -25,7 +25,7 @@ module.exports = function addDevMiddlewares(app, webpackConfig) {
25
25
  heartbeat: 10 * 1000,
26
26
  }),
27
27
  );
28
- app.use(express.static('cdn'));
28
+ app.use(expressStaticGzip('cdn'));
29
29
 
30
30
  const { outputFileSystem } = (middleware || {}).context || {};
31
31
 
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
- const express = require('express');
3
2
  const compression = require('compression');
3
+ const expressStaticGzip = require('express-static-gzip');
4
4
  const { sendFileWithCSPNonce } = require('../csp');
5
5
 
6
6
  module.exports = function addProdMiddlewares(app, options) {
@@ -17,8 +17,15 @@ module.exports = function addProdMiddlewares(app, options) {
17
17
  sendFileWithCSPNonce({ outputPath, res });
18
18
  });
19
19
 
20
- app.use(publicPath, express.static(outputPath, { index: false }));
21
- app.use(express.static('cdn'));
20
+ app.use(
21
+ publicPath,
22
+ expressStaticGzip(outputPath, {
23
+ index: false,
24
+ enableBrotli: true,
25
+ orderPreference: ['br'],
26
+ }),
27
+ );
28
+ app.use(expressStaticGzip('cdn'));
22
29
 
23
30
  app.get('*', (req, res) => sendFileWithCSPNonce({ outputPath, res }));
24
31
  };
@@ -77,7 +77,6 @@ const getAlias = () =>
77
77
  'redux-saga',
78
78
  'moment',
79
79
  'lodash',
80
- 'connected-react-router',
81
80
  'styled-components',
82
81
  'immer',
83
82
  'react-dates',
@@ -188,7 +187,7 @@ const isGoogleTagManagerEnabled = () => {
188
187
 
189
188
  const getCompressionPlugins = () => {
190
189
  const commonConfig = {
191
- test: /\.(js|css|html|svg)$/,
190
+ test: /\.(js|css)$/,
192
191
  exclude: [
193
192
  /\/adrum-ext/,
194
193
  /\/emuiUserMonitoring/,
@@ -102,7 +102,6 @@ const plugins = [
102
102
  new WebpackManifestPlugin(),
103
103
  new FaviconsWebpackPlugin({
104
104
  logo: './app/view/images/favicon.png',
105
- manifest: null,
106
105
  favicons: {
107
106
  developerName: 'ICE MT',
108
107
  developerURL: null, // prevent retrieving from the nearest package.json
@@ -127,22 +126,7 @@ module.exports = (options) => ({
127
126
  module: {
128
127
  rules: [
129
128
  {
130
- test: /\.(jpe?g|png|gif|ico)$/,
131
- use: [
132
- 'file-loader',
133
- {
134
- loader: 'image-webpack-loader',
135
- options: {
136
- gifsicle: {
137
- enabled: false,
138
- },
139
- },
140
- },
141
- ],
142
- enforce: 'pre',
143
- },
144
- {
145
- test: /\.(js|ts|jsx|tsx)$/,
129
+ test: /\.[jt]sx?$/,
146
130
  enforce: 'pre',
147
131
  exclude: /node_modules/,
148
132
  resolve: {
@@ -159,7 +143,7 @@ module.exports = (options) => ({
159
143
  ],
160
144
  },
161
145
  {
162
- test: /\.(js|jsx)$/,
146
+ test: /\.[j]sx?$/,
163
147
  exclude: excludeNodeModulesExcept(modulesToTranspile),
164
148
  resolve: {
165
149
  fullySpecified: false,
@@ -173,7 +157,7 @@ module.exports = (options) => ({
173
157
  },
174
158
  },
175
159
  {
176
- test: /\.(ts|tsx)$/,
160
+ test: /\.[t]sx?$/,
177
161
  exclude: excludeNodeModulesExcept(modulesToTranspile),
178
162
  resolve: {
179
163
  fullySpecified: false,
@@ -226,12 +210,7 @@ module.exports = (options) => ({
226
210
  use: ['@svgr/webpack'],
227
211
  },
228
212
  {
229
- test: /\.(jpe?g|png|gif|ico)$/i,
230
- exclude: excludeNodeModulesExcept(['@elliemae/*']),
231
- type: 'asset',
232
- },
233
- {
234
- test: /\.(mp4|webm)$/,
213
+ test: /\.(jpe?g|png|gif|ico|mp4|webm)$/i,
235
214
  exclude: excludeNodeModulesExcept(['@elliemae/*']),
236
215
  type: 'asset',
237
216
  },
@@ -251,7 +230,6 @@ module.exports = (options) => ({
251
230
  extensions: ['.wasm', '.mjs', '.ts', '.tsx', '.js', '.jsx', '.json'],
252
231
  mainFields: ['browser', 'module', 'main'],
253
232
  alias: {
254
- 'lodash-es': 'lodash',
255
233
  ...getAlias(),
256
234
  ...((options.resolve || {}).alias || {}),
257
235
  },
@@ -73,21 +73,6 @@ module.exports = (options) => ({
73
73
  optimization: options.optimization,
74
74
  module: {
75
75
  rules: [
76
- {
77
- test: /\.(jpe?g|png|gif|svg|ico)$/,
78
- use: [
79
- 'file-loader',
80
- {
81
- loader: 'image-webpack-loader',
82
- options: {
83
- gifsicle: {
84
- enabled: false,
85
- },
86
- },
87
- },
88
- ],
89
- enforce: 'pre',
90
- },
91
76
  {
92
77
  test: /^(?!.*\.exec\.js$).*\.(js|ts|jsx|tsx)$/,
93
78
  enforce: 'pre',
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@elliemae/pui-cli",
3
- "version": "6.0.0-beta.17",
3
+ "version": "6.0.0-beta.18",
4
4
  "private": false,
5
- "description": "EllieMae Platform UI CLI",
5
+ "description": "ICE MT UI Platform CLI",
6
6
  "sideEffects": false,
7
7
  "main": "./lib/index.js",
8
8
  "module": "./lib/index.js",
@@ -20,10 +20,10 @@
20
20
  "url": "https://git.elliemae.io/platform-ui/pui-cli.git"
21
21
  },
22
22
  "engines": {
23
- "npm": ">=7",
24
- "node": ">=14"
23
+ "npm": ">=8",
24
+ "node": ">=16"
25
25
  },
26
- "author": "Vinoth Kalyanasundaram",
26
+ "author": "ICE MT",
27
27
  "license": "MIT",
28
28
  "scripts": {
29
29
  "build": "exit 0",
@@ -152,9 +152,11 @@
152
152
  "eslint-plugin-storybook": "~0.5.2",
153
153
  "eslint-plugin-testing-library": "~5.0.1",
154
154
  "eslint-plugin-wdio": "~7.4.2",
155
+ "express-static-gzip": "~2.1.1",
155
156
  "execa": "~5.1.1",
156
157
  "express": "~4.17.1",
157
158
  "express-pino-logger": "~7.0.0",
159
+ "favicons": "~6.2.2",
158
160
  "favicons-webpack-plugin": "~5.0.2",
159
161
  "file-loader": "~6.2.0",
160
162
  "fork-ts-checker-webpack-plugin": "~6.5.0",
@@ -164,7 +166,6 @@
164
166
  "http-server": "~14.0.0",
165
167
  "husky": "~7.0.4",
166
168
  "husky-init": "~7.0.0",
167
- "image-webpack-loader": "~8.0.1",
168
169
  "imports-loader": "~3.1.1",
169
170
  "ip": "~1.1.5",
170
171
  "jest-axe": "~5.0.1",
@@ -242,7 +243,7 @@
242
243
  "webpack-pwa-manifest": "~4.3.0",
243
244
  "webpack-strip-block": "~0.3.0",
244
245
  "whatwg-fetch": "~3.6.2",
245
- "workbox-webpack-plugin": "~6.4.1",
246
+ "workbox-webpack-plugin": "~6.4.2",
246
247
  "yargs": "~17.3.0"
247
248
  },
248
249
  "devDependencies": {