@elliemae/pui-cli 7.27.1 → 7.27.2
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.
|
@@ -39,6 +39,7 @@ var import_circular_dependency_plugin = __toESM(require("circular-dependency-plu
|
|
|
39
39
|
var import_mini_css_extract_plugin = __toESM(require("mini-css-extract-plugin"), 1);
|
|
40
40
|
var import_react_refresh_webpack_plugin = __toESM(require("@pmmmwh/react-refresh-webpack-plugin"), 1);
|
|
41
41
|
var import_speed_measure_webpack_plugin = __toESM(require("speed-measure-webpack-plugin"), 1);
|
|
42
|
+
var import_express_static_gzip = __toESM(require("express-static-gzip"), 1);
|
|
42
43
|
var import_middlewares = require("../server/middlewares.js");
|
|
43
44
|
var import_app_routes = require("../server/app-routes.cjs");
|
|
44
45
|
var import_helpers = require("./helpers.js");
|
|
@@ -148,6 +149,15 @@ const devConfig = {
|
|
|
148
149
|
setupMiddlewares: (middlewares, devServer) => {
|
|
149
150
|
(0, import_middlewares.setupDefaultMiddlewares)(devServer.app);
|
|
150
151
|
(0, import_app_routes.loadRoutes)(devServer.app);
|
|
152
|
+
const cdnRouter = (0, import_express_static_gzip.default)("cdn");
|
|
153
|
+
devServer.app.use((req, res, next) => {
|
|
154
|
+
const parsedPath = import_node_path.default.parse(req.url);
|
|
155
|
+
if (parsedPath?.ext) {
|
|
156
|
+
cdnRouter(req, res, next);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
next();
|
|
160
|
+
});
|
|
151
161
|
return middlewares;
|
|
152
162
|
}
|
|
153
163
|
}
|
|
@@ -6,6 +6,7 @@ import CircularDependencyPlugin from "circular-dependency-plugin";
|
|
|
6
6
|
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
7
7
|
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
|
|
8
8
|
import SpeedMeasurePlugin from "speed-measure-webpack-plugin";
|
|
9
|
+
import expressStaticGzip from "express-static-gzip";
|
|
9
10
|
import { setupDefaultMiddlewares } from "../server/middlewares.js";
|
|
10
11
|
import { loadRoutes } from "../server/app-routes.cjs";
|
|
11
12
|
import {
|
|
@@ -118,6 +119,15 @@ const devConfig = {
|
|
|
118
119
|
setupMiddlewares: (middlewares, devServer) => {
|
|
119
120
|
setupDefaultMiddlewares(devServer.app);
|
|
120
121
|
loadRoutes(devServer.app);
|
|
122
|
+
const cdnRouter = expressStaticGzip("cdn");
|
|
123
|
+
devServer.app.use((req, res, next) => {
|
|
124
|
+
const parsedPath = path.parse(req.url);
|
|
125
|
+
if (parsedPath?.ext) {
|
|
126
|
+
cdnRouter(req, res, next);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
next();
|
|
130
|
+
});
|
|
121
131
|
return middlewares;
|
|
122
132
|
}
|
|
123
133
|
}
|