Skip to content

Commit 35a37e5

Browse files
committed
refactor: 💡 use cleaner logic for excluded api build modules
1 parent 49cd107 commit 35a37e5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎addons/api/index.js‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ module.exports = {
4545
},
4646

4747
treeForAddon() {
48-
const includeMirage = this._includeMirageInBuild();
49-
5048
// Exclude anything in the workers folder from being bundled in the final
5149
// build as we're manually bundling the files ourselves below.
50+
const excludedModules = ['api/workers/**/*'];
51+
52+
if (!this._includeMirageInBuild()) {
53+
excludedModules.push('api/mirage/**/*');
54+
}
55+
5256
const tree = this._super.treeForAddon.apply(this, arguments);
5357
return funnel(tree, {
54-
exclude: ['api/workers/**/*', !includeMirage && 'api/mirage/**/*'].filter(
55-
Boolean,
56-
),
58+
exclude: excludedModules,
5759
});
5860
},
5961

0 commit comments

Comments
 (0)