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

Provide plugins list to rollup_bundle #532

Closed
mattjs opened this issue Feb 6, 2019 · 3 comments
Closed

Provide plugins list to rollup_bundle #532

mattjs opened this issue Feb 6, 2019 · 3 comments
Milestone

Comments

@mattjs
Copy link

mattjs commented Feb 6, 2019

It would be great if we were able to provide plugins to rollup_bundle to perform processing tasks with babel or other libraries.

If I understand rollup_bundle.bzl correctly it might be possible to add a new attribute to rollup_bundle to pass a list of plugins to write_rollup_config

I looked into some related issues but wasn't able to find this exactly. Maybe there is some way to do this already?

Related issues:
#217
#211
#488

@mattjs
Copy link
Author

mattjs commented Feb 8, 2019

Worked on a proof of concept by following the angular customization seen in ng_rollup_bundle

https://github.com/mattjs/react-bazel

I was able to get react with jsx bundled properly.

Missing from the rollup config was the ability to declare externals

external: [
  'react',
  'react-dom',
],

And other than that I just piped in plugins to TMPL_additional_plugins.

@kellycampbell
Copy link
Contributor

kellycampbell commented Jul 24, 2019

Missing from the rollup config was the ability to declare externals

external: [
  'react',
  'react-dom',
],

I started going down this route of customizing the rollup rules for react, and then found that you can declare the externals via the globals attribtue. E.g.:

rollup_bundle(
    ...
    globals = {
        "react": "React",
        "react-dom": "ReactDOM",
    },
}

@alexeagle alexeagle added this to the 1.0 milestone Aug 23, 2019
@alexeagle
Copy link
Collaborator

alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 5, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 9, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 9, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 2019
alexeagle added a commit to alexeagle/rules_nodejs that referenced this issue Sep 10, 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

No branches or pull requests

3 participants