This might seem superfluous, but from browsing the issues history it seems that a common thing to want is conditional shimming. Meaning you would like to shim some dependencies given some conditions, while in other cases you would like them baked in. Typically in build setups with multiple targets. This could also probably appease some of the needs of the one's wanting to do inline transforms. From the comments in some of the issues it seemed like one way of doing this would be to rewrite the external shim config file based on these conditions, but once I realized we are just talking about a normal CommonJS package the sky's the limit, so to speak, when it comes to ways of approaching this.
So maybe you could add a tip to the README on ways of achieving this? A quick hack, just to test out the concept, was for me to check for a condition in my gulpfile.js and set a global flag SHOULD_SHIM based on that. I would check for that in shim-config.js and configure the module's exports based on that.
This might seem superfluous, but from browsing the issues history it seems that a common thing to want is conditional shimming. Meaning you would like to shim some dependencies given some conditions, while in other cases you would like them baked in. Typically in build setups with multiple targets. This could also probably appease some of the needs of the one's wanting to do inline transforms. From the comments in some of the issues it seemed like one way of doing this would be to rewrite the external shim config file based on these conditions, but once I realized we are just talking about a normal CommonJS package the sky's the limit, so to speak, when it comes to ways of approaching this.
So maybe you could add a tip to the README on ways of achieving this? A quick hack, just to test out the concept, was for me to check for a condition in my
gulpfile.js
and set a global flagSHOULD_SHIM
based on that. I would check for that inshim-config.js
and configure the module's exports based on that.