From 2cb26c2231e8dfcce657b6f63359d24a8c7217ed Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Thu, 14 Sep 2023 16:40:11 +0200 Subject: [PATCH] fix(webpack): set keep_quoted_props: true in TerserOptions (#10382) --- .../__snapshots__/angular.spec.ts.snap | 10 ++++++++-- .../__snapshots__/base.spec.ts.snap | 10 ++++++++-- .../__snapshots__/javascript.spec.ts.snap | 10 ++++++++-- .../__snapshots__/react.spec.ts.snap | 20 +++++++++++++++---- .../__snapshots__/svelte.spec.ts.snap | 10 ++++++++-- .../__snapshots__/typescript.spec.ts.snap | 10 ++++++++-- .../__snapshots__/vue.spec.ts.snap | 10 ++++++++-- packages/webpack5/src/configuration/base.ts | 3 +++ 8 files changed, 67 insertions(+), 16 deletions(-) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap index d6d658648..8277481bf 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/angular.spec.ts.snap @@ -325,7 +325,10 @@ exports[`angular configuration for android 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -751,7 +754,10 @@ exports[`angular configuration for ios 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/base.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/base.spec.ts.snap index 4f131a1b2..45cea7b2f 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/base.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/base.spec.ts.snap @@ -218,7 +218,10 @@ exports[`base configuration for android 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -539,7 +542,10 @@ exports[`base configuration for ios 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap index 25ff25ec5..2c95c5366 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/javascript.spec.ts.snap @@ -218,7 +218,10 @@ exports[`javascript configuration for android 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -538,7 +541,10 @@ exports[`javascript configuration for ios 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap index 84e482f85..6c2f49d62 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/react.spec.ts.snap @@ -240,7 +240,10 @@ exports[`react configuration > android > adds ReactRefreshWebpackPlugin when HMR } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -572,7 +575,10 @@ exports[`react configuration > android > base config 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -911,7 +917,10 @@ exports[`react configuration > ios > adds ReactRefreshWebpackPlugin when HMR ena } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -1244,7 +1253,10 @@ exports[`react configuration > ios > base config 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap index 1586380fb..a6aa87a6e 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/svelte.spec.ts.snap @@ -245,7 +245,10 @@ exports[`svelte configuration for android 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -587,7 +590,10 @@ exports[`svelte configuration for ios 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap index 767cb350f..80b35cbed 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/typescript.spec.ts.snap @@ -218,7 +218,10 @@ exports[`typescript configuration for android 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -538,7 +541,10 @@ exports[`typescript configuration for ios 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) diff --git a/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap b/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap index 3cb689ecc..0d5c03ec9 100644 --- a/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap +++ b/packages/webpack5/__tests__/configuration/__snapshots__/vue.spec.ts.snap @@ -250,7 +250,10 @@ exports[`vue configuration for android 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) @@ -605,7 +608,10 @@ exports[`vue configuration for ios 1`] = ` } }, keep_fnames: true, - keep_classnames: true + keep_classnames: true, + format: { + keep_quoted_props: true + } } } ) diff --git a/packages/webpack5/src/configuration/base.ts b/packages/webpack5/src/configuration/base.ts index f9f99f362..5df26fe9c 100644 --- a/packages/webpack5/src/configuration/base.ts +++ b/packages/webpack5/src/configuration/base.ts @@ -157,6 +157,9 @@ export default function (config: Config, env: IWebpackEnv = _env): Config { }, keep_fnames: true, keep_classnames: true, + format: { + keep_quoted_props: true, + }, }, }, ]);