Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ignore specific bower components #73

Open
MilosMosovsky opened this issue Aug 26, 2015 · 2 comments
Open

Allow ignore specific bower components #73

MilosMosovsky opened this issue Aug 26, 2015 · 2 comments

Comments

@MilosMosovsky
Copy link

Hello , currently i am developing angular.js application with browserify . I am using both NPM + Bower, but i am facing problem that i have installed angular both in bower and npm , but i want to force load it from npm, because bower repo is broken for browserify. Also some modules has newer version in npm repos than bower (but some other modules has its dependecy so it is force loaded via bower)

Currently i made this changes to debowerify

https://github.com/eugeneware/debowerify/blob/master/index.js#L8

module.exports = function (file, options, module_options) {

  var defaultConfig = {
      ignoreModules : []
  };
  var bowerModules;
  if (!options) options = {};
  module_options = module_options || defaultConfig;

i made new function parameter to set debowerify options , so i can pass my new ignoreModules parameter.

Then i skipped this module here

https://github.com/eugeneware/debowerify/blob/master/index.js#L100

      //break if module should be ignored
      if(module_options.ignoreModules.indexOf(moduleName) !== -1) return;

then i adjusted my browserify build to :

  bundler.transform(function(file,options) {
    var config = { ignoreModules : [
        'angular'
    ]};
    return debowerify(file,options,config)
  });

Let me know if this is worth of PR or i should make own forked version of debowerify. Thanks.

@ilovett
Copy link

ilovett commented Nov 11, 2015

👍 this would also be good for loading from an external browserify bundle

@Merott
Copy link
Contributor

Merott commented Nov 19, 2015

I've made a PR to support a preferNPM option, which ignores any bower components that are also found to be installed as node modules. See #78.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants