Skip to content

Commit

Permalink
Only serialize the options we need
Browse files Browse the repository at this point in the history
`this.options` can contain arbitrary unserializable data (such as
Broccoli trees, Webpack plugins, etc).

Fixes #1441
  • Loading branch information
chancancode committed Jun 27, 2023
1 parent 9b83c11 commit 21c56b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/compat/src/compat-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,13 @@ class CompatAppAdapter implements AppAdapter<TreeNames, CompatResolverOptions> {
activeAddons[addon.name] = addon.root;
}

let options: CompatResolverOptions['options'] = {
staticHelpers: this.options.staticHelpers,
staticModifiers: this.options.staticModifiers,
staticComponents: this.options.staticComponents,
allowUnsafeDynamicComponents: this.options.allowUnsafeDynamicComponents,
};

let config: CompatResolverOptions = {
// this part is the base ModuleResolverOptions as required by @embroider/core
activeAddons,
Expand All @@ -379,8 +386,8 @@ class CompatAppAdapter implements AppAdapter<TreeNames, CompatResolverOptions> {
// global template resolving
modulePrefix: this.modulePrefix(),
podModulePrefix: this.podModulePrefix(),
options: this.options,
activePackageRules: this.activeRules(),
options,
};

return config;
Expand Down

0 comments on commit 21c56b2

Please sign in to comment.