cli: do not apply react-hot-loader transforms for backend development
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Fixed a bug were the `react-hot-loader` transform was being applied to backend development builds.
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user