Last active
December 15, 2015 04:29
-
-
Save ryanfitzer/5202101 to your computer and use it in GitHub Desktop.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!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 | |
}); | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment