bundle-collapser
bundle-collapser copied to clipboard
Option to define custom require method or blacklisting strings
I’m using Nunjucksify and I have the problem described in this issue. Since I believe plugin runs after all transforms are applied, it can’t know about additional created requires - in the case of Nunjucks, it’s env.getTemplate({module-name}).
Is it possbile to have option to define custom require method or option to blacklist particular strings inside requires? That way bundle-collapser will just ignore those modules.
I’ve created pull request for this issue. Implementation could be changed if you would like more expressive or easier approach. Also, it works only from API, I don’t know how it could be achieved from CLI (other than providing some configuration file).