browserify / bundle-collapser

convert bundle paths to IDs to save bytes in browserify bundles
Other
194 stars 21 forks source link

Option to define custom require method or blacklisting strings #16

Open niksy opened 9 years ago

niksy commented 9 years ago

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.

niksy commented 9 years ago

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).