mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 15:04:52 +09:00
Fix mainBundle being passed as array in dev mode
Values in the assetsByChunkName object are arrays not strings. This
caused the dev mode to fail after 2f4e0c4418 added an additional step
filtering out the static/ prefix from what it expected to be a string.
This commit is contained in:
1 parent
9d061a0f53
commit
a025d01294
2 files changed
+2
-2
No files matched your search
@@ -1237,7 +1237,7 @@ export default class Controller {
|
||||
mainBundle = res.app.locals.mainBundle;
|
||||
} else {
|
||||
let stats = res.locals.webpack.devMiddleware.stats.stats[0];
|
||||
mainBundle = stats.toJson().assetsByChunkName["main"];
|
||||
mainBundle = stats.toJson().assetsByChunkName["main"][0];
|
||||
}
|
||||
mainBundle = routes.stripStaticPrefix(mainBundle);
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ function getPlugins(req: Request, res: Response) {
|
||||
let devPlugins = req.app.locals.devPlugins;
|
||||
if (devPlugins && devPlugins.has(name)) {
|
||||
let stats = res.locals.webpack.devMiddleware.stats.stats[devPlugins.get(name)!];
|
||||
web.main = stats.toJson().assetsByChunkName[name];
|
||||
web.main = stats.toJson().assetsByChunkName[name][0];
|
||||
} else if (pluginInfo.manifest) {
|
||||
web.main = pluginInfo.manifest[`${pluginInfo.name}.js`];
|
||||
if (!web.main) {
|
||||
|
||||
Reference in new issue
Block a user