The following will minify your assets with grunt each time a generation write completes.
-
Install Dependencies
npm install --save grunt bal-util
-
Create your website's grunt file to specify what we should minify. Guide here.
-
Add the following to your docpad configuration file
# Write After # Used to minify our assets with grunt writeAfter: (opts,next) -> # Prepare balUtil = require('bal-util') docpad = @docpad rootPath = docpad.config.rootPath # Perform the grunt `min` task # https://github.com/gruntjs/grunt/blob/0.3-stable/docs/task_min.md command = ["#{rootPath}/node_modules/.bin/grunt", 'min'] # Execute balUtil.spawn(command, {cwd:rootPath,output:true}, next) # Chain @