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

inlineDynamicImports per output #2701

Closed
ashubham opened this issue Feb 16, 2019 · 3 comments · Fixed by #3645
Closed

inlineDynamicImports per output #2701

ashubham opened this issue Feb 16, 2019 · 3 comments · Fixed by #3645

Comments

@ashubham
Copy link

Expected Behavior / Situation

inlineDynamicImports should work per output. For eg. I have a project with dynamic imports which I want to bundle for Modern Browsers(Chrome/Safari) using native dynamic imports. Also, I want to create an IIFE for IE11/FF, with the dynamic imports inlined in the output bundle.

Actual Behavior / Situation

inlineDynamicImports is a top level config option, making it all or nothing. The workaround is to have multiple configurtions and run rollup again but that is sub optimal.

Modification Proposal

Make inlineDynamicImports an output level configuration item.

@andrewebdev
Copy link

andrewebdev commented Feb 18, 2019

@ashubham
Not sure if you are aware but your config can be a list, so you can specify multiple different configs.

export default = [
  {
    inlineDynamicImports: true,
    ...
  },

  {
    inlineDynamicImports: false,  // Technically this isn't required, just placing it here as example
    ...
  }
]

@ashubham
Copy link
Author

ashubham commented Feb 21, 2019

Oh thats nice, I did not know it. Thanks @andrewebdev

Although, while it solves the issue there is still redundant code (like plugins, input etc). Which I agree we can work around by having common var for all the config.

Still, I think since its a property which transforms the output in some way it should be namespaced to output config item.

@lukastaegert
Copy link
Member

You might be interested to know that #3645 will implement what you originally suggested

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 a pull request may close this issue.

3 participants