sku 0.0.0-webpack-dev-server-2022942468 → 0.0.0-webpack-dev-server-20229554335

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # sku
2
2
 
3
- ## 0.0.0-webpack-dev-server-2022942468
3
+ ## 0.0.0-webpack-dev-server-20229554335
4
4
 
5
5
  ### Patch Changes
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sku",
3
- "version": "0.0.0-webpack-dev-server-2022942468",
3
+ "version": "0.0.0-webpack-dev-server-20229554335",
4
4
  "description": "Front-end development toolkit, powered by Webpack, Babel, CSS Modules, Less and Jest",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -65,15 +65,15 @@
65
65
  "@babel/preset-typescript": "^7.12.7",
66
66
  "@babel/runtime": "^7.12.5",
67
67
  "@loadable/babel-plugin": "^5.13.2",
68
- "@loadable/component": "^5.14.1",
69
- "@loadable/server": "^5.14.0",
70
- "@loadable/webpack-plugin": "^5.14.0",
71
- "@pmmmwh/react-refresh-webpack-plugin": "0.5.0-rc.2",
68
+ "@loadable/component": "^5.15.2",
69
+ "@loadable/server": "^5.15.2",
70
+ "@loadable/webpack-plugin": "^5.15.2",
71
+ "@pmmmwh/react-refresh-webpack-plugin": "0.5.7",
72
72
  "@storybook/builder-webpack5": "^6.3.6",
73
73
  "@storybook/manager-webpack5": "^6.3.6",
74
74
  "@storybook/react": "^6.3.4",
75
75
  "@types/jest": "^27.0.0",
76
- "@types/loadable__component": "^5.13.1",
76
+ "@types/loadable__component": "^5.13.4",
77
77
  "@vanilla-extract/babel-plugin": "^1.0.0",
78
78
  "@vanilla-extract/webpack-plugin": "^2.0.0",
79
79
  "@vocab/core": "^1.1.0",
@@ -152,7 +152,7 @@ const localhost = '0.0.0.0';
152
152
  onDeath(() => {
153
153
  serverManager.kill();
154
154
 
155
- devServer.close(() => {
155
+ devServer.stopCallback(() => {
156
156
  debug('Webpack dev server closed');
157
157
  });
158
158
  serverCompiler.close(() => {
package/scripts/start.js CHANGED
@@ -73,7 +73,6 @@ const hot = process.env.SKU_HOT !== 'false';
73
73
  });
74
74
 
75
75
  const appHosts = getAppHosts();
76
- console.log({ appHosts });
77
76
 
78
77
  const devServerConfig = {
79
78
  devMiddleware: {
@@ -119,63 +118,56 @@ const hot = process.env.SKU_HOT !== 'false';
119
118
  }
120
119
  }
121
120
 
122
- middlewares.push({
123
- name: 'foo',
124
- path: '*',
125
- middleware: (req, res, next) => {
126
- const matchingSiteName = getSiteForHost(req.hostname);
127
-
128
- const matchingRoute = routes.find(({ route, siteIndex }) => {
129
- if (
130
- typeof siteIndex === 'number' &&
131
- matchingSiteName !== sites[siteIndex].name
132
- ) {
133
- return false;
134
- }
135
-
136
- return routeMatcher(route)(req.path);
137
- });
121
+ middlewares.push((req, res, next) => {
122
+ const matchingSiteName = getSiteForHost(req.hostname);
138
123
 
139
- if (!matchingRoute) {
140
- return next();
124
+ const matchingRoute = routes.find(({ route, siteIndex }) => {
125
+ if (
126
+ typeof siteIndex === 'number' &&
127
+ matchingSiteName !== sites[siteIndex].name
128
+ ) {
129
+ return false;
141
130
  }
142
131
 
143
- let chosenLanguage;
132
+ return routeMatcher(route)(req.path);
133
+ });
134
+
135
+ if (!matchingRoute) {
136
+ return next();
137
+ }
138
+
139
+ let chosenLanguage;
140
+
141
+ try {
142
+ chosenLanguage = getLanguageFromRoute(req, matchingRoute);
143
+ } catch (e) {
144
+ return res.status(500).send(
145
+ exceptionFormatter(e, {
146
+ format: 'html',
147
+ inlineStyle: true,
148
+ basepath: 'webpack://static/./',
149
+ }),
150
+ );
151
+ }
144
152
 
145
- try {
146
- chosenLanguage = getLanguageFromRoute(req, matchingRoute);
147
- } catch (e) {
148
- return res.status(500).send(
149
- exceptionFormatter(e, {
153
+ htmlRenderPlugin
154
+ .renderWhenReady({
155
+ route: getRouteWithLanguage(matchingRoute.route, chosenLanguage),
156
+ routeName: matchingRoute.name,
157
+ site: matchingSiteName,
158
+ language: chosenLanguage,
159
+ environment,
160
+ })
161
+ .then((html) => res.send(html))
162
+ .catch((renderError) => {
163
+ res.status(500).send(
164
+ exceptionFormatter(renderError, {
150
165
  format: 'html',
151
166
  inlineStyle: true,
152
167
  basepath: 'webpack://static/./',
153
168
  }),
154
169
  );
155
- }
156
-
157
- htmlRenderPlugin
158
- .renderWhenReady({
159
- route: getRouteWithLanguage(
160
- matchingRoute.route,
161
- chosenLanguage,
162
- ),
163
- routeName: matchingRoute.name,
164
- site: matchingSiteName,
165
- language: chosenLanguage,
166
- environment,
167
- })
168
- .then((html) => res.send(html))
169
- .catch((renderError) => {
170
- res.status(500).send(
171
- exceptionFormatter(renderError, {
172
- format: 'html',
173
- inlineStyle: true,
174
- basepath: 'webpack://static/./',
175
- }),
176
- );
177
- });
178
- },
170
+ });
179
171
  });
180
172
 
181
173
  return middlewares;