cli: disable sucrase ES transforms
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Disabled ECMAScript transforms in app and backend builds in order to reduce bundle size and runtime performance. For the rationale and a full list of syntax that is no longer transformed, see https://github.com/alangpierce/sucrase#transforms. This also enables TypeScripts `useDefineForClassFields` flag by default, which in rare occasions could cause build failures. For instructions on how to mitigate issues due to the flag, see the [TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier).
|
||||
@@ -33,6 +33,7 @@
|
||||
"strictPropertyInitialization": true,
|
||||
"stripInternal": true,
|
||||
"target": "ES2019",
|
||||
"types": ["node", "jest", "webpack-env"]
|
||||
"types": ["node", "jest", "webpack-env"],
|
||||
"useDefineForClassFields": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ export const transforms = (options: TransformOptions): Transforms => {
|
||||
loader: require.resolve('@sucrase/webpack-loader'),
|
||||
options: {
|
||||
transforms: ['typescript', 'jsx', ...extraTransforms],
|
||||
disableESTransforms: true,
|
||||
production: !isDev,
|
||||
},
|
||||
},
|
||||
@@ -48,6 +49,7 @@ export const transforms = (options: TransformOptions): Transforms => {
|
||||
loader: require.resolve('@sucrase/webpack-loader'),
|
||||
options: {
|
||||
transforms: ['jsx', ...extraTransforms],
|
||||
disableESTransforms: true,
|
||||
production: !isDev,
|
||||
},
|
||||
},
|
||||
@@ -64,6 +66,7 @@ export const transforms = (options: TransformOptions): Transforms => {
|
||||
loader: require.resolve('@sucrase/webpack-loader'),
|
||||
options: {
|
||||
transforms: ['jsx', ...extraTransforms],
|
||||
disableESTransforms: true,
|
||||
production: !isDev,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user