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

Unable to override ignore on node_modules #44

Closed
cheapsteak opened this issue Feb 19, 2015 · 6 comments
Closed

Unable to override ignore on node_modules #44

cheapsteak opened this issue Feb 19, 2015 · 6 comments

Comments

@cheapsteak
Copy link

Setting the ignore option to something else still causes packages in node_modules to be ignored.

{
    optional: ['selfContained'],
    experimental: true,
    ignore: 'blarg'
};

If I'm requiring a file inside node_modules I still get

[15:55:50] gulp-notify: [Compile Error] Parsing file /Users/me/my-project/node_modules/some-repo-with-es6/src/file-with-es6.js: Unexpected token (37:22)
@sebmck
Copy link

sebmck commented Feb 19, 2015

This is default browserify behaviour that you cannot override. Try my suggestion here.

@sebmck sebmck closed this as completed Feb 19, 2015
@cheapsteak
Copy link
Author

Thank you! 🙇 That worked

@cheapsteak
Copy link
Author

Sorry to bug you again 🙇
Is there a way to declare what options need to be passed to the babelify transform of modules inside of node_modules?
Currently it's being called with only the default options.
I tried declaring the options in the package.json of the module inside node_modules but it doesn't seem to be read

"browserify": {
    "transform": [
      "babelify"
    ]
},
"babelify": {
    "optional": ["selfContained"],
    "experimental": true
},

@sebmck
Copy link

sebmck commented Feb 19, 2015

"browserify": {
    "transform": [
      [
        "babelify",
        {
          "optional": ["selfContained"],
          "experimental": true
        }
      ]
    ]
}

should work.

@cheapsteak
Copy link
Author

Holy crap, I'm an idiot.
Thank you so much.

This was referenced Feb 28, 2015
@jbmusso
Copy link

jbmusso commented May 15, 2015

To complement @sebmck's answer, users may want to have a look at https://github.com/substack/module-deps#packagejson-transformkey which browserify internally uses for setting transform options from the package.json file. To quote the documentation, make sure you "use a 2-element array inside of the primary array" - I've just been bitten by this and spent/lost some time figuring out what was wrong (typo).

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