Description
Please provide us with the following information:
OS?
Windows 10 x64
Versions.
@angular/cli: 1.0.0-rc.1
node: 6.9.1
os: win32 x64
Repro steps.
Update package.json from @angular/cli": "1.0.0-rc.0
to @angular/cli": "1.0.0-rc.1
.
The log given by the failure.
Cannot find name 'require'
Cannot find namespace 'ol'
Cannot find name 'describe'
Cannot find name 'beforeEach'
Cannot find name 'it'
Cannot find name 'expect'
Mention any other details that might be useful.
When using certain 3rd party libraries or require()
you need to add the types to the tsconfig.app.json
as described here https://github.com/angular/angular-cli/wiki/stories-third-party-lib. In the latest RC1 it looks like the types
option is ignored resulting the above error. If I remove the types
entry and replace it with the global typeRoots
entry it seems to work but is not ideal to pull in all types. This also affects the tsconfig.spec.json
.
Breaks in RC1, used to work in RC0
{
"compilerOptions": {
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016",
"dom"
],
"outDir": "../out-tsc/app",
"target": "es5",
"module": "es2015",
"baseUrl": "",
"types": [
"node",
"openlayers"
]
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
Work around for RC1
{
"compilerOptions": {
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016",
"dom"
],
"outDir": "../out-tsc/app",
"target": "es5",
"module": "es2015",
"baseUrl": "",
"typeRoots": [
"../node_modules/@types"
]
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}