Skip to content

Commit

Permalink
FIX only namespae preprocessJs tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Edwards committed May 21, 2022
1 parent 89ec0c7 commit 2b53658
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/compat/src/v1-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,22 +488,26 @@ export default class V1Addon {

// applies preprocessors to JS and HBS
private transpile(tree: Node) {
// Namespace the tree being passed to preprocessJs with the moduleName
// to mimic classic build
tree = buildFunnel(tree, { destDir: this.moduleName });

tree = this.addonInstance.preprocessJs(tree, '/', this.moduleName, {
registry: this.addonInstance.registry,
});

// Remove namespacing so that it gets written out to the node_modules
// directory correctly.
tree = buildFunnel(tree, {
srcDir: this.moduleName,
});

if (this.addonInstance.shouldCompileTemplates() && this.addonInstance.registry.load('template')?.length > 0) {
tree = this.app.preprocessRegistry.preprocessTemplates(tree, {
registry: this.addonInstance.registry,
});
}

tree = buildFunnel(tree, {
srcDir: this.moduleName,
});

return tree;
}

Expand Down

0 comments on commit 2b53658

Please sign in to comment.