Skip to content
This repository was archived by the owner on Jul 21, 2022. It is now read-only.

Commit f565091

Browse files
filipesilvaBrocco
authored andcommitted
fix(new): fix relativeRootPath for typeRoots
Fix angular#2206 Close angular#2597
1 parent 5cfa51d commit f565091

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/angular-cli/blueprints/ng2/files/__path__/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"sourceMap": true,
1212
"target": "es5",
1313
"typeRoots": [
14-
"../node_modules/@types"
14+
"<%= relativeRootPath %>/node_modules/@types"
1515
]
1616
}
1717
}

packages/angular-cli/blueprints/ng2/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ module.exports = {
2626
this.styleExt = options.style;
2727
this.version = require(path.resolve(__dirname, '../../package.json')).version;
2828

29-
// Join with / not path.sep as reference to typings require forward slashes.
30-
const relativeRootPath = options.sourceDir.split(path.sep).map(() => '..').join('/');
29+
// Split/join with / not path.sep as reference to typings require forward slashes.
30+
const relativeRootPath = options.sourceDir.split('/').map(() => '..').join('/');
3131
const fullAppName = stringUtils.dasherize(options.entity.name)
3232
.replace(/-(.)/g, (_, l) => ' ' + l.toUpperCase())
3333
.replace(/^./, (l) => l.toUpperCase());

0 commit comments

Comments
 (0)