Skip to content

Commit 271be28

Browse files
committed
fix: precompile puts addon-test-support declarations in the correct place
1 parent 4c156b3 commit 271be28

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ module.exports = {
6969
},
7070

7171
treeForTestSupport() {
72-
let trees = [this.compiler.treeForTests()];
72+
let trees = [];
7373
if (this.compiler) {
74+
trees.push(this.compiler.treeForTests());
7475
let babel = this.project.addons.find(addon => addon.name === 'ember-cli-babel');
7576
let tree = this.compiler.treeForTestSupport();
7677
trees.push(babel.transpileTree(tree));

lib/commands/precompile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ module.exports = Command.extend({
4747

4848
// We can only do anything meaningful with declarations for files in addon/ or src/
4949
if (this._isAddonFile(declSource)) {
50-
let declDest = declSource.replace(/^addon\//, '');
50+
let declDest = declSource
51+
.replace(/^addon\//, '')
52+
.replace(/^addon-test-support/, 'test-support');
5153
this._copyFile(output, `${outDir}/${declSource}`, declDest);
5254
} else if (this._isSrcFile(declSource)) {
5355
this._copyFile(output, `${outDir}/${declSource}`, declSource);

0 commit comments

Comments
 (0)