public
Last active

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.

  • Download Gist
build.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
!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
csscat.init({
dir: dir
});
}();

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.