@enact/cli 5.0.1 → 5.0.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.
- package/CHANGELOG.md +8 -0
- package/commands/serve.js +19 -10
- package/npm-shrinkwrap.json +1732 -1664
- package/package.json +91 -87
package/CHANGELOG.md
CHANGED
package/commands/serve.js
CHANGED
|
@@ -211,22 +211,31 @@ function devServerConfig(host, port, protocol, publicPath, proxy, allowedHost) {
|
|
|
211
211
|
},
|
|
212
212
|
// `proxy` is run between `before` and `after` `webpack-dev-server` hooks
|
|
213
213
|
proxy,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
devServer.app.use(evalSourceMapMiddleware(devServer));
|
|
214
|
+
setupMiddlewares(middlewares, devServer) {
|
|
215
|
+
if (!devServer) {
|
|
216
|
+
throw new Error('webpack-dev-server is not defined');
|
|
217
|
+
}
|
|
219
218
|
|
|
220
219
|
// Optionally register app-side proxy middleware if it exists
|
|
221
220
|
const proxySetup = path.join(process.cwd(), 'src', 'setupProxy.js');
|
|
222
221
|
if (fs.existsSync(proxySetup)) {
|
|
223
222
|
require(proxySetup)(devServer.app);
|
|
224
223
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
224
|
+
|
|
225
|
+
middlewares.unshift(
|
|
226
|
+
// Keep `evalSourceMapMiddleware`
|
|
227
|
+
// middlewares before `redirectServedPath` otherwise will not have any effect
|
|
228
|
+
// This lets us fetch source contents from webpack for the error overlay
|
|
229
|
+
evalSourceMapMiddleware(devServer)
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
middlewares.push(
|
|
233
|
+
// Redirect to `PUBLIC_URL` or `homepage`/`enact.publicUrl` from `package.json`
|
|
234
|
+
// if url not match
|
|
235
|
+
redirectServedPathMiddleware(publicPath)
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
return middlewares;
|
|
230
239
|
}
|
|
231
240
|
};
|
|
232
241
|
}
|