Skip to content

Commit

Permalink
fix: user compilation config lose
Browse files Browse the repository at this point in the history
  • Loading branch information
luhc228 committed Oct 9, 2023
1 parent 6f18c3d commit cf1c496
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/plugin-rax-compat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ const plugin: Plugin<CompatRaxOptions> = (options = {}) => ({
type: false,
});

// Must create a variable to store the original compilationConfig.
const originalSwcCompilationConfig = typeof config.swcOptions?.compilationConfig === 'object'
? cloneDeep(config.swcOptions?.compilationConfig || {})
: {};
const compilationConfigFunc = typeof config.swcOptions?.compilationConfig === 'function'
? config.swcOptions?.compilationConfig
: () => config.swcOptions?.compilationConfig;
: () => originalSwcCompilationConfig;

// Reset jsc.transform.react.runtime to classic.
config.swcOptions = merge(config.swcOptions || {}, {
Expand Down

0 comments on commit cf1c496

Please sign in to comment.