@ngtools/webpack does not build by entrypoint imports
up vote
0
down vote
favorite
I use @ngtools/webpack directly in angular-app (withou angular-cli) and i got unexpected behavior. Aot plugin build all ts-files in project, but some files not imported by entrypoint file (main.ts). For expample - ts-loader build only files that find by imports in entrypoint file (main.ts). This is bug or feature?
I created mini-repo: https://github.com/alxpsr/ngtools-unexpected
Run npm run build:aot and you got an error. But if you run npm run build:tsloader - the build will not have an error.
If this is not a bug, please tell me what the difference between this two builds?
P.S. I know about files and include option in tsconfig.json and i can specify files more clearly there. I want to understand the differences between these two builds. ^_^
angular aot ngtools
add a comment |
up vote
0
down vote
favorite
I use @ngtools/webpack directly in angular-app (withou angular-cli) and i got unexpected behavior. Aot plugin build all ts-files in project, but some files not imported by entrypoint file (main.ts). For expample - ts-loader build only files that find by imports in entrypoint file (main.ts). This is bug or feature?
I created mini-repo: https://github.com/alxpsr/ngtools-unexpected
Run npm run build:aot and you got an error. But if you run npm run build:tsloader - the build will not have an error.
If this is not a bug, please tell me what the difference between this two builds?
P.S. I know about files and include option in tsconfig.json and i can specify files more clearly there. I want to understand the differences between these two builds. ^_^
angular aot ngtools
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I use @ngtools/webpack directly in angular-app (withou angular-cli) and i got unexpected behavior. Aot plugin build all ts-files in project, but some files not imported by entrypoint file (main.ts). For expample - ts-loader build only files that find by imports in entrypoint file (main.ts). This is bug or feature?
I created mini-repo: https://github.com/alxpsr/ngtools-unexpected
Run npm run build:aot and you got an error. But if you run npm run build:tsloader - the build will not have an error.
If this is not a bug, please tell me what the difference between this two builds?
P.S. I know about files and include option in tsconfig.json and i can specify files more clearly there. I want to understand the differences between these two builds. ^_^
angular aot ngtools
I use @ngtools/webpack directly in angular-app (withou angular-cli) and i got unexpected behavior. Aot plugin build all ts-files in project, but some files not imported by entrypoint file (main.ts). For expample - ts-loader build only files that find by imports in entrypoint file (main.ts). This is bug or feature?
I created mini-repo: https://github.com/alxpsr/ngtools-unexpected
Run npm run build:aot and you got an error. But if you run npm run build:tsloader - the build will not have an error.
If this is not a bug, please tell me what the difference between this two builds?
P.S. I know about files and include option in tsconfig.json and i can specify files more clearly there. I want to understand the differences between these two builds. ^_^
angular aot ngtools
angular aot ngtools
asked Nov 10 at 14:39
Alxpsr
11
11
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Both the builds are different. When building using AOT, the code is compiled using the angular compiler. It compiles all your code before deploying so the client-browser doesn't have to do much work. For example, if you have called a function in HTML, but don't have the function defined in your component, the Angular Compiler will give you error while building the app itself.
On the other hand, when you build using tsloader, the build succeeds, but the app breaks on runtime when you encounter such an error.
Yes, thank you. But i don't understand why ts-loader compiler step by step by imports, when ngtools compile whole project.
– Alxpsr
2 days ago
Its not the ngtools, but the Angular compiler plugin that you are using which makes the difference. The tsloader also compiles the complete project, ignoring the HTML error, such as incorrect tag ending, function call.
– Sachin Gupta
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Both the builds are different. When building using AOT, the code is compiled using the angular compiler. It compiles all your code before deploying so the client-browser doesn't have to do much work. For example, if you have called a function in HTML, but don't have the function defined in your component, the Angular Compiler will give you error while building the app itself.
On the other hand, when you build using tsloader, the build succeeds, but the app breaks on runtime when you encounter such an error.
Yes, thank you. But i don't understand why ts-loader compiler step by step by imports, when ngtools compile whole project.
– Alxpsr
2 days ago
Its not the ngtools, but the Angular compiler plugin that you are using which makes the difference. The tsloader also compiles the complete project, ignoring the HTML error, such as incorrect tag ending, function call.
– Sachin Gupta
2 days ago
add a comment |
up vote
0
down vote
Both the builds are different. When building using AOT, the code is compiled using the angular compiler. It compiles all your code before deploying so the client-browser doesn't have to do much work. For example, if you have called a function in HTML, but don't have the function defined in your component, the Angular Compiler will give you error while building the app itself.
On the other hand, when you build using tsloader, the build succeeds, but the app breaks on runtime when you encounter such an error.
Yes, thank you. But i don't understand why ts-loader compiler step by step by imports, when ngtools compile whole project.
– Alxpsr
2 days ago
Its not the ngtools, but the Angular compiler plugin that you are using which makes the difference. The tsloader also compiles the complete project, ignoring the HTML error, such as incorrect tag ending, function call.
– Sachin Gupta
2 days ago
add a comment |
up vote
0
down vote
up vote
0
down vote
Both the builds are different. When building using AOT, the code is compiled using the angular compiler. It compiles all your code before deploying so the client-browser doesn't have to do much work. For example, if you have called a function in HTML, but don't have the function defined in your component, the Angular Compiler will give you error while building the app itself.
On the other hand, when you build using tsloader, the build succeeds, but the app breaks on runtime when you encounter such an error.
Both the builds are different. When building using AOT, the code is compiled using the angular compiler. It compiles all your code before deploying so the client-browser doesn't have to do much work. For example, if you have called a function in HTML, but don't have the function defined in your component, the Angular Compiler will give you error while building the app itself.
On the other hand, when you build using tsloader, the build succeeds, but the app breaks on runtime when you encounter such an error.
answered Nov 10 at 15:25
Sachin Gupta
26416
26416
Yes, thank you. But i don't understand why ts-loader compiler step by step by imports, when ngtools compile whole project.
– Alxpsr
2 days ago
Its not the ngtools, but the Angular compiler plugin that you are using which makes the difference. The tsloader also compiles the complete project, ignoring the HTML error, such as incorrect tag ending, function call.
– Sachin Gupta
2 days ago
add a comment |
Yes, thank you. But i don't understand why ts-loader compiler step by step by imports, when ngtools compile whole project.
– Alxpsr
2 days ago
Its not the ngtools, but the Angular compiler plugin that you are using which makes the difference. The tsloader also compiles the complete project, ignoring the HTML error, such as incorrect tag ending, function call.
– Sachin Gupta
2 days ago
Yes, thank you. But i don't understand why ts-loader compiler step by step by imports, when ngtools compile whole project.
– Alxpsr
2 days ago
Yes, thank you. But i don't understand why ts-loader compiler step by step by imports, when ngtools compile whole project.
– Alxpsr
2 days ago
Its not the ngtools, but the Angular compiler plugin that you are using which makes the difference. The tsloader also compiles the complete project, ignoring the HTML error, such as incorrect tag ending, function call.
– Sachin Gupta
2 days ago
Its not the ngtools, but the Angular compiler plugin that you are using which makes the difference. The tsloader also compiles the complete project, ignoring the HTML error, such as incorrect tag ending, function call.
– Sachin Gupta
2 days ago
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240009%2fngtools-webpack-does-not-build-by-entrypoint-imports%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password