Posts

Showing posts with the label gulp

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

How to reference npm'd sass files

Image
Clash Royale CLAN TAG #URR8PPP How to reference npm'd sass files If I npm install bootstrap, or npm install neat, how do I reference these in my scss files? Do I have to know the exact path in the npm_modules folder? If I try: @import "neat" or @import "bootstrap" I get an error saying it can't find the path. Is the best way to not even use npm and just download the scss files into a folder and reference it from there? 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.

Gulp, postcss and UnCSS

Image
Clash Royale CLAN TAG #URR8PPP Gulp, postcss and UnCSS I'm trying to clean up my css and use UnCSS with gulp and Postcss. I have this: gulp.task('optim-css', function() { var stream1 = gulp.src(['dev/css/bootstrap.min.css','dev/css/custom.css']) .pipe(postcss([ rucksack() ])) .pipe(postcss(uncss({ html: ['http://localhost/olssonseder/','http://localhost/olssonseder/lyssna/','http://localhost/olssonseder/repertoar/','http://localhost/olssonseder/kontakta/','http://localhost/olssonseder/kontakta/','http://localhost/olssonseder/om-gitarren/'], ignore: [new RegExp('.b-lazy*'), new RegExp('.stickyFooter')] })) ); var stream2 = gulp.src(['dev/css/responsive-nav.css','dev/css/lity.css','dev/css/mp3-player-button.css']) return merge(stream1, stream2) .pipe(concat(...