Babelify: Don't want to process `node_modules` files

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Babelify: Don't want to process `node_modules` files



I'm using babelify in my gulp task like this.


babelify


gulp.task( 'compileJS', function() {
browserify( './scripts/es/main.js')
.transform( babelify ) // Transpiles all ES6 JS to ES5 JS code.
.bundle()
.pipe( source( 'bundle.js' ) )
.pipe( gulp.dest( './scripts/js/') )
})



Now in my main.js file i'm importing many modules from node_modules. The issue is that this task not only imports the node module's file (i.e. the main file defined in respective module's package.json file) but it also imports any dependecies of that file too.


main.js


node_modules


main


package.json



What I want is to simply import the module file "as it is" without processing it. How can I achieve this behaviour?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived