Skip to content

Add rollup-plugin-amd to rollup_bundle to support bundling *.ngfactory.js AMD files generated by ngc - #625

Merged
alexeagle merged 1 commit into
bazel-contrib:masterfrom
gregmagolan:rollup-amd-plugin
Mar 25, 2019
Merged

alexeagle merged 1 commit into
bazel-contrib:masterfrom
gregmagolan:rollup-amd-plugin

Conversation

@gregmagolan

@gregmagolan gregmagolan commented Mar 22, 2019 •

Copy link
Copy Markdown
Collaborator

This is a workaround for the following issue angular/angular#29491

@gregmagolan

Copy link
Copy Markdown
Collaborator Author

Needs a test before landing

…y.js AMD files generated by ngc

This is a workaround for the following issue angular/angular#29491
*/

try {
require.resolve('shelljs');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not add a shelljs dependency - we are making everyone who uses rules_nodejs download this, right? or at least anyone who loads from the rollup rule. We can probably just do this with node APIs

// Part of work-around for Angular ngfactory issue https://github.com/angular/angular/issues/29491.
console.log(
'\n# patch: @buxlabs/amd-to-es6 to generate namespace imports instead of default imports');
sed('-i', 'ImportDefaultSpecifier', 'ImportNamespaceSpecifier',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an issue filed for this, a PR against upstream, etc? how do we avoid needing to patch this in the future?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll ask about this in an issue for amd-plugin. We may be able to land this as a configuration option for the plugin but I don't think we can change the default behavior as that would break anyone using it.

@alexeagle
alexeagle merged commit 15cf523 into bazel-contrib:master Mar 25, 2019
@gregmagolan gregmagolan mentioned this pull request Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants