factor-bundle icon indicating copy to clipboard operation
factor-bundle copied to clipboard

Add the possibility to ignore local dependencies in factorization process

Open PaGury opened this issue 9 years ago • 1 comments

Hi,

It is possible to ignore some dependencies in the factorization process ?

I have 3 files

page1.js

var domready = require('domready');
var React = require('react/addons');
var localScript = require('./common/localScript');

domready(function() {
    // stuff
});

page2.js

var React = require('react/addons');
var localScript = require('./common/localScript');

domready(function() {
    // stuff
});

page3.js

var domready = require('domready');
var localScript2 = require('./common/localScript2');

domready(function() {
    // stuff
});

It would be great if we were able to configure factor-bundle to export domready and react/addons (node_modules dependencies) in a 'common-bundle.js' file. And able to ignore the 'localScript' for each files (maybe based on a regex, or a parameter 'ignoreLocalsDependencies').

Why ?

The export of common node_modules dependencies is pretty nice and usefull, but i do not want to export these locals dependencies in the common-bundle file. These locals would be used only in a few scripts and it's unnecessary to factorize. Unlike the node_modules dependencies.

PaGury avatar Nov 18 '15 09:11 PaGury

Might be worth looking at #16

casr avatar Sep 03 '17 15:09 casr