-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Not working "Why aren't files in node_modules being transformed?" #284
Comments
This works for me: |
I can confirm that babelify does not globally transform |
@niftylettuce I am seeing this too. I'm not able to transform any of the required node_modules. even when I set |
@builtbylane I have a pretty cool solution/alternative that even has factor-bundle built-in. Will share soon. IMO there is a core bug somewhere here that nobody has figured out or dedicated time to. Obviously this is broken. The better solution is to run browserify and then babel separately. |
@niftylettuce I was just starting to go down that same path but got sidetracked. Please share! 🥗 |
I just have to push it up, need a little bit longer |
Assuming you're using Babel 7: |
OK it's done. v0.2.9 of Lad has an updated gulp config that satisfies our needs here. npm install -g lad https://github.com/ladjs/lad/blob/master/template/gulpfile.js#L181-L199 Happy hacking, and feel free to join our Slack @ https://slack.crocodilejs.com/ |
@loganfsmyth I've changed my config file to babel.config.js to no avail. Babelify still doesn't honor my settings for the node_modules |
I can't seem to get this to work at all. The global option no longer works, setting ignores in my gulpfile does not work, removing my config into babel.config.js or babel.config.json does not work. I'm stumped as to how I can transfom a package. Any help would be greatly appreciated. |
any news about this ?....... |
Does anybody know how the ignore pattern can be used inside npm scripts on the command line? I have this in my npm scripts: "js": "browserify script.js --outfile bundle.js -t [ babelify --global --ignore [ node_modules\/(?!swiper) ] ]", Result: "js": "browserify script.js --outfile bundle.js -t [ babelify --global --ignore [ node_modules\/\\(?!swiper\\) ] ]", Result: |
Just found a clever way: "js": "browserify script.js --outfile bundle.js -t [ babelify --global --only [ _js node_modules\/swiper ] ]", You can define more packages to transform by adding them (space separated) to the array of |
Gentlemen, I believe we all have been deceived by Windows once again. babelOpts: {
ignore: [ /node_modules\/(?!whatwg-fetch)/ ],
presets: [ [Array] ],
assumptions: { arrayLikeIsIterable: true },
sourceType: 'module',
cwd: 'C:\\Users\\maxim\\browserify-temp',
caller: { name: 'babelify' },
filename: 'C:\\Users\\maxim\\browserify-temp\\node_modules\\core-js\\internals\\to-object.js',
sourceFileName: undefined
} So the fix is to make it platform-independent: ignore: [/[/\\]node_modules[/\\](?!whatwg-fetch[/\\])/], Hope it helps! |
Not working:
.transform(babelify, { global: true, ignore: [/\/node_modules\/(?!app\/)/] })
The text was updated successfully, but these errors were encountered: