Skip to content

Instantly share code, notes, and snippets.

Last active Dec 15, 2015
What would you like to do?
CSSCat does not copy the files into a new directory before processing. The following snippet shows how to use use CSSCat's fs-helper.js in your build.js file to create a copy of the original directory.
!function() {
var path = require( 'path' )
, csscat = require( 'csscat' )
, fsh = require( 'csscat/lib/fsh' )
// The directory to copy (relative to this file)
var original = './';
// The base directory (relative to this file)
var dir = '../app-build';
// Resolve to absolute paths (relative to this file's directory)
original = path.resolve( __dirname, original );
dir = path.resolve( __dirname, dir );
// Delete destination directory
if ( fsh.exists( dir ) ) fsh.rm( dir );
// Copy the target directory to the destination directory
console.log( '\nCopying files to the destination directory at "' + dir + '"');
fsh.copyDir( original, dir );
// Now that the we have fresh copy, let's get busy on it
dir: dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment