Posts

Showing posts with the label browserify

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

Image
Clash 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...