Menu icon Foundation
npm build question

Hi,

I am developing with Foundation according to the instructions, and everything works great .. I run "npm start" and everytime i save my scss file it is automatically compiled into css. I really want to add something to this build process so that the css file is then copies to a directory I specify, but I have not the slightest clue how to do this? Any help greatly appreciated, sorry if simple question but I don't use npm, gulp, git or anything involved in this for anything but Foundation so not very knowledgeable on it!

npm

Hi,

I am developing with Foundation according to the instructions, and everything works great .. I run "npm start" and everytime i save my scss file it is automatically compiled into css. I really want to add something to this build process so that the css file is then copies to a directory I specify, but I have not the slightest clue how to do this? Any help greatly appreciated, sorry if simple question but I don't use npm, gulp, git or anything involved in this for anything but Foundation so not very knowledgeable on it!

Philip King over 2 years ago

In gulpfile.babel.js you'll find a sass function, which is where the sass is compiled to css. You can add an extra line here to pipe the output to an additional location. For instance, adding this line:

    .pipe(gulp.dest(PATHS.dist + '/assets/css'))
    .pipe(gulp.dest(PATHS.dist + '/mylocation')) // <-- added line

will duplicate your app.css file to a new folder "mylocation" at the top of your dist/ folder.

Tom C over 2 years ago

Thanks a lot, yep that worked great!

Philip King over 2 years ago

Glad to help. It's not that long ago it was all a mystery to me too.