Rollup: inlineDynamicImports per output

Created on 16 Feb 2019  路  3Comments  路  Source: rollup/rollup

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.

Most helpful comment

@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
    ...
  }
]

All 3 comments

@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
    ...
  }
]

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adammockor picture adammockor  路  3Comments

otakustay picture otakustay  路  3Comments

azdavis picture azdavis  路  3Comments

iam-peekay picture iam-peekay  路  3Comments

nanomosfet picture nanomosfet  路  3Comments