Skip to content
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

Support & Feature request : Add ngc compile single file api for vite/snowpack #18599

Closed
xiaoxiangmoe opened this issue Aug 23, 2020 · 4 comments

Comments

@xiaoxiangmoe
Copy link

xiaoxiangmoe commented Aug 23, 2020

I have wrote a POC demo for using vite with Angular: https://github.com/xiaoxiangmoe/vite-ng-app-demo
In demo, it combines ngc --watch and vite serve by concurrently.
If we want to write a vite-plugin-angular. We may need ngc to compile single file.related issue: angular/angular#37585angular/angular#20422 (comment)

In the future, we may be able to provide functions such as hmr based on vite.
Moreover, we may be able to provide snowpack plugins based on the same API.

related issue: vitejs/vite#543

@alan-agius4
Copy link
Collaborator

Hi @xiaoxiangmoe,

Thanks for this feature request. We are following closely the development of ESBuild, Rollup, Webpack, snowpack and other build tools.

That being said, we are not planning to move away from Webpack yet. At least not in the near future. In fact currently we actively working on adding support for the next major version of Webpack.

Let’s continue tracking the single file emit angular/angular#37585.

@xiaoxiangmoe
Copy link
Author

xiaoxiangmoe commented Aug 23, 2020

@alan-agius4 Can I raise some toolchain related questions in this issue?
For example:

  • How can I access ngc API in third-party tools?
  • Does ngc have rollup-plugin support?

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Aug 23, 2020

For such questions I think stackoverflow/Gitter is a better place.

Does ngc have rollup-plugin support?

There is no official ngc rollup plugin. But there a community plugin here: https://github.com/aelbore/rollup-plugin-ngc

How can I access ngc API in third-party tools?

The main methods are createProgram and createCompilerHost, these are used with the TypeScript API. You can take a look at the above plugin so see a usage.

@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 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants