cli: do not apply react-hot-loader transforms for backend development

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-04-07 12:37:57 +02:00
parent 06bbaf96df
commit df7862cfa6
3 changed files with 9 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Fixed a bug were the `react-hot-loader` transform was being applied to backend development builds.
+1 -1
View File
@@ -226,7 +226,7 @@ export async function createBackendConfig(
// See frontend config
const externalPkgs = packages.filter(p => !isChildPath(paths.root, p.dir));
const { loaders } = transforms(options);
const { loaders } = transforms({ ...options, isBackend: true });
const runScriptNodeArgs = new Array<string>();
if (options.inspectEnabled) {
+3 -2
View File
@@ -25,12 +25,13 @@ type Transforms = {
type TransformOptions = {
isDev: boolean;
isBackend?: boolean;
};
export const transforms = (options: TransformOptions): Transforms => {
const { isDev } = options;
const { isDev, isBackend } = options;
const extraTransforms = isDev ? ['react-hot-loader'] : [];
const extraTransforms = isDev && !isBackend ? ['react-hot-loader'] : [];
// This ensures that styles inserted from the style-loader and any
// async style chunks are always given lower priority than JSS styles.