javascript - parametrizing browserifiy bundle contents -


i've got project built (bundled) browserify. supports functionalities different locales (different languages). currently, locales loaded using commonjs requires in row:

exports.a = require('./a') exports.b = require('./b') exports.c = require('./c') ...

but, may expect, bundle big , typical user uses 1 locale @ time. case parametrize bundle somehow. question is: how it best way.

the brute-force thought of provide input parameter list of locales, generate node module require chosen locales , run browserify against it. it's nasty brute force, looking else.

the transforms, such globify, allow bungle chosen filepath wildcards. i'm not sure whether can use in case.

there partitioning in browserify: factor-bundle , partition-bundle. analysing partition bundle in case: create map of locales loaded in browser runtime. haven't tried it.

i'd appreciate hints on solution in case.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -