question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

please release babel files as @ngtools/babel

See original GitHub issue

With build-optimizer being deprecated now, having to install @angular-devkit/build-angular with a rather chunky dependency tree - nearly all depedencies pinned to a specific version - is unfortunate.

Do you plan to release https://github.com/angular/angular-cli/tree/master/packages/angular_devkit/build_angular/src/babel as @ngtools/babel just like @ngtools/webpack? Or as @angular-devkit/build-babel in the vein of @angular-devkit/build-webpack.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
dgp1130commented, Jan 13, 2022

Hi @sod, @angular-devkit/build-optimizer is not really considered a public API. It’s experimental on NPM (not yet 1.0.0) and is effectively an implementation detail of the Angular CLI. The extra package wasn’t really necessary, so we folded it into @angular-devkit/build-angular since the only supported usage is through the CLI itself. Refactoring this directory out of @angular-devkit/build-angular and into another package is just making it easier for users to depend on private implementation details which could change in the future.

If users really want to depend on these private APIs anyways, they can deep import from @angular-devkit/build-angular. The package is bigger than it needs to be for that purpose as you mentioned, but that is the nature of leveraging private APIs. Even then, we may end up adding Node.js exports in the future, which could break deep imports as well. The most maintainable solution would probably involve forking the repository and deleting the unnecessary pieces or vendoring the NPM package and altering it to meet your needs.

I think the more important question is about your actual use case. Is there something in particular you’re trying to do that requires this package? Problems like optimizing Angular output for production builds are exactly the kind of things the CLI is intended to solve. Is there a reason you can’t use the CLI and need to directly leverage these private APIs?

0reactions
angular-automatic-lock-bot[bot]commented, Feb 14, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel CLI
Babel comes with a built-in CLI which can be used to compile files from the command line.
Read more >
babel/polyfill
Available from the dist/polyfill.js file within a @babel/polyfill npm release. This needs to be included before all your compiled Babel code.
Read more >
Config Files - Babel.js
File -relative configuration. Babel loads .babelrc.json files, or an equivalent one using the supported extensions, by searching up the directory structure ...
Read more >
Configure Babel
Create a file called .babelrc.json with the following content in your project. { "presets": [...], "plugins ...
Read more >
FAQ - Babel.js
Please see babel/rfcs#5, google/traceur-compiler#1773 and babel/babel#838 for more ... config file to get all the same transforms that were in Babel 5:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found