Skip to content

Commit 19774b9

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 3bcacb6 commit 19774b9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/broccoli/angular2-app.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,23 @@ 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

72+
tsTree = new Funnel(tsTree, {
73+
srcDir: 'src',
74+
exclude: ['*.d.ts', 'tsconfig.json']
75+
});
76+
6777
var tsSrcTree = new Funnel(sourceDir, {
6878
include: ['**/*.ts'],
6979
allowEmpty: true

0 commit comments

Comments
 (0)