Issue
I just started learning Angular 2. The tutorials which I'm following mentioned that all the compiled files go into the dist folder. By compiled files, he meant the typescript files which got transpiled to javascript.
But I didn't get any dist folder when I created my project using Angular 2 CLI. Attached is a snapshot of my project structure.
Note: There're few folders that were created by me at a later stage and were not part of default angular2 structure.
Also, when I looked into tsconfig.json file, it had following code.
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
Since there's dist directory mentioned in outDir property of the object then my project must have a dist folder somewhere. Am I missing something here?
Solution
When you will run the compiler, it will create a folder with name dist. Try to run ng build command if you have used Angular CLI. After this command the compiler will compile ts into js, make bundles and put them into the dist folder.
Answered By - Suren Srapyan

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.