Skip to content

feature(@ngtools/webpack): add an option to skip code generation. #3181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 23, 2016

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Nov 17, 2016

Fix #3072

@JamesHenry
Copy link
Contributor

JamesHenry commented Nov 21, 2016

@hansl Forgive me, I am still trying to get my head around the intended usage of @ngtools/webpack for non-angular-cli projects - will this PR essentially make the loader from @ngtools/webpack a first class equivalent of ts-loader or awesome-typescript-loader? (Albeit those will having some additional features which are not necessarily required).

Essentially I got @ngtools/webpack working well with building my hybrid ng1 and ng2 app with AoT, but ran into a strange runtime issue with Injectable when attempting run the code in JIT mode via my dev server.

I was attempting to use @ngtools/webpack without using the AoTPlugin (in development, I was of course using it for the prod build).

I tracked the issue with that down the decorator metadata not being emitted by the backup ts program you create in such cases where the plugin is not available (https://github.com/angular/angular-cli/blob/master/packages/webpack/src/loader.ts#L162). When attempting to research whether or not to submit that as an issue, I found this PR.

I was naturally hoping to use the same tooling across dev, testing and prod (i.e. not have to use awesome-typescript-loader only for dev), would you recommend I simply wait for this PR to land, or is the best way still to use awesome-typescript-loader?

Thanks for all your hard work!

@hansl
Copy link
Contributor Author

hansl commented Nov 21, 2016

@JamesHenry The Webpack AoT plugin already acts as a replacement for ATL and TS-Loader. With this PR it allows you to use JIT compiling for faster compile times. As such, inside the CLI it will replace ATL entirely.

This PR will allow you to use the same plugin and loader for both development (with JIT) and production (with AoT).

@JamesHenry
Copy link
Contributor

Perfect! Thanks for getting back to me so quickly. Are there any outstanding tasks ahead of merging?

With this being a nested subdirectory, is there a way to easily npm install the WIP from this PR branch?

@hansl
Copy link
Contributor Author

hansl commented Nov 21, 2016

Not easily. Just wait for the release :) It will be soon after this lands.

@JamesHenry
Copy link
Contributor

Ha fair enough! Thanks for the help

@hansl hansl force-pushed the webpack-no-aot branch 2 times, most recently from faf16e2 to d80f57e Compare November 22, 2016 00:46
@hansl hansl force-pushed the webpack-no-aot branch 6 times, most recently from 99aeeee to 9db998b Compare November 22, 2016 22:40
@hansl hansl force-pushed the webpack-no-aot branch 2 times, most recently from 449aa32 to 0765308 Compare November 23, 2016 05:41
@hansl
Copy link
Contributor Author

hansl commented Nov 23, 2016

I'm going to submit this as I need to work on other things. As far as I can tell, this is ready and at least as feature complete as the current master. We'll address bugs before the next release.

Cheers!

@hansl hansl merged commit f9a7c01 into angular:master Nov 23, 2016
@JamesHenry
Copy link
Contributor

Thanks! As in the next release of the CLI, or @ngtools/webpack itself?

@hansl
Copy link
Contributor Author

hansl commented Nov 23, 2016

We release both at the same time, so yes. ;)

MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
…gular#3181)

Also use that option to replace awesome-typescript-loader.
@hansl hansl deleted the webpack-no-aot branch August 2, 2018 19:58
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
clydin pushed a commit to clydin/angular-cli that referenced this pull request Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: option to disable AoT in @ngtools/webpack plugin
4 participants