Skip to content

Commit 8398d95

Browse files
committed
fix(build): compile source files from within the src/ directory
We need to preserve the paths to be the same during build as they are in source repo, so that editor and build pipeline are aligned.
1 parent 2cd5535 commit 8398d95

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/broccoli/angular2-app.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,15 @@ Angular2App.prototype.toTree = function() {
5757
});
5858

5959
// TODO(i): kill rootFilePaths in broccoli-typescript and use tsconfig.json#files instead
60-
tsConfigCompilerOptions.rootFilePaths = tsConfigCompilerOptions.rootFilePaths.concat(tsconfig.files);
60+
tsConfigCompilerOptions.rootFilePaths = tsConfigCompilerOptions.rootFilePaths.
61+
concat(tsconfig.files.map(function(p) {
62+
// TODO(i): this is a hack - for some reason we need to prefix all paths with srcDir because
63+
// tsc's "rootDir" doesn't take effect when resolving "files" paths
64+
return path.join(sourceDir, p);
65+
}));
6166

6267

63-
var srcAndTypingsTree = mergeTrees([sourceDir, typingsTree]);
68+
var srcAndTypingsTree = mergeTrees([sourceTree, typingsTree]);
6469

6570
var tsTree = compileWithTypescript(srcAndTypingsTree, tsConfigCompilerOptions);
6671

0 commit comments

Comments
 (0)