deeleman / learning-angular2

Code samples repository for the examples provided in "Learning Angular 2", published by Packt Publishing - THE BOOK COVERS UP TO RC.1 and hence is severely OUTDATED. PLEASE REFER TO THE LATEST EDITIONS INSTEAD.
https://www.packtpub.com/web-development/learning-angular-2
108 stars 59 forks source link

Running tsc init didn't generate a rootDir or outDIr. #9

Closed ykoehler closed 8 years ago

ykoehler commented 8 years ago

Here is the output emitted in my tsconfig.json avec running the tsc init as specific in the book.

{
    "compilerOptions": {
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "target": "es5",
        "module": "system",
        "moduleResolution": "node",
        "noImplicitAny": false,
        "sourceMap": false
    },
    "exclude": [
        "node_modules"
    ]
}

Note the missing rootDir and outDir.

I doubt those are important, but since in your chapter you actually do mention them and talk explicitely about those two, you may need to put a note that they may or not appears in the generated tsconfig.json.

rootDir: This points to the folder the compiler will use to scan for TypeScript files to compile (currently the base folder in our example).
outDir: This defines where the compiled files will be moved unless we define our own output path by means of the --outDir parameter in the command line, the compiler will default to the built folder created at runtime in the same location where the tsconfig.json file lives.
deeleman commented 8 years ago

Good point. Will do for sure! :)

Thanks for noticing!

stevefarwell commented 8 years ago

same issue, I updated the file manually

deeleman commented 8 years ago

The TypeScript compiler evolved over the past months. While originally (at the time of writing this book) the tsc init command created rootDir and outDir properties, it removed those from the output at some stage.

Now that everybody's well aware of this circumstance, let's close this issue.