git clone https://github.com/jquery/jquery-ui.git
cd jquery-ui
git checkout ref-1029-css-dependency-comments
npm install builder-jquery-css async glob
wget https://gist.githubusercontent.com/rxaviers/01ab3bc43bf9f42c769f/raw/3b7295b66ebc0e2d7b4753780f6075131b086409/build-css.js
node build-css.js
Last active
August 29, 2015 14:14
-
-
Save rxaviers/01ab3bc43bf9f42c769f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var async = require( "async" ); | |
var path = require( "path" ); | |
var jQueryCSSBuilder = require( "builder-jquery-css" ); | |
var glob = require( "glob" ); | |
var fs = require( "fs" ); | |
var files = {}; | |
glob.sync( "./ui/*.js", { nodir: true } ).forEach(function( filepath ) { | |
files[ path.relative( ".", filepath ) ] = fs.readFileSync( filepath ); | |
}) | |
glob.sync( "./themes/base/*.css", { nodir: true } ).forEach(function( filepath ) { | |
files[ path.relative( ".", filepath ) ] = fs.readFileSync( filepath ); | |
}) | |
files[ "jquery.js" ] = "define(function() {});" | |
async.parallel([ "structure", "theme" ].map(function( selector ) { | |
return function( callback ) { | |
jQueryCSSBuilder( files, selector, { | |
appDir: "ui", | |
include: [ "accordion", "autocomplete", "button", "core", "datepicker", | |
"dialog", "draggable", "droppable", "effect-blind", "effect-bounce", | |
"effect-clip", "effect-drop", "effect-explode", "effect-fade", | |
"effect-fold", "effect-highlight", "effect", "effect-puff", | |
"effect-pulsate", "effect-scale", "effect-shake", "effect-size", | |
"effect-slide", "effect-transfer", "menu", "mouse", "position", | |
"progressbar", "resizable", "selectable", "selectmenu", "slider", | |
"sortable", "spinner", "tabs", "tooltip", "widget" | |
], | |
paths: { | |
"jquery": "../jquery" | |
} | |
}, function( error, css, files ) { | |
if ( error ) { | |
return callback( error ); | |
} | |
console.log( "Writing jquery-ui." + selector + ".css" ); | |
fs.writeFileSync( "jquery-ui." + selector + ".css", css ); | |
callback(); | |
}); | |
}; | |
}), function( error ) { | |
if ( error ) { | |
console.error( error ); | |
throw error; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment