Node dependency trees tend to be pretty large, so I'm a little concerned
here. Has the memory footprint be measured?

Cheers,
 David

On 31/07/17 19:45, Michael Cooper wrote:
> If you mean using modules from NPM in a browser add-on, the Shield client
> extension recently started doing this <
> https://github.com/mozilla/normandy/tree/master/recipe-client-addon>
> 
> We do this by using webpack to process the node modules, bundling the
> entire dependency tree of a library into a single file. We then add a few
> more bits to make the resulting file compatible with `Chrome.utils.import`.
> You can see the webpack config file here <
> https://github.com/mozilla/normandy/blob/master/recipe-client-addon/webpack.config.js>
> and the way we use the resulting files here <
> https://github.com/mozilla/normandy/blob/48a446cab33d3b261b87c3d509964987e044289d/recipe-client-addon/lib/FilterExpressions.jsm#L12
>>
> 
> We suspect that this approach won't be compatible with all Node libraries,
> because it is fairly naive. But it has worked well for the ones we've used
> (React, ReactDOM, ajv, and mozjexl, so far).
> 
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to