Added CSS processing to Makefile. Rewrote minification instructions

master
David Long 11 years ago
parent f268640571
commit 1ba5bb03f2

@ -36,23 +36,37 @@ JS_FILES = \
src/models/stackedArea.js \
src/models/stackedAreaChart.js \
src/outro.js
CSS_FILES = \
src/nv.d3.css
JS_COMPILER = \
uglifyjs
all: nv.d3.js nv.d3.min.js
CSS_COMPILER = \
cssmin
all: nv.d3.js nv.d3.min.js nv.d3.css nv.d3.min.css
nv.d3.js: $(JS_FILES)
nv.d3.min.js: $(JS_FILES)
nv.d3.css: $(CSS_FILES)
nv.d3.min.css: $(CSS_FILES)
nv.d3.js: Makefile
rm -f $@
cat $(filter %.js,$^) >> $@
nv.d3.css: Makefile
rm -f $@
cat $(filter %.css,$^) >> $@
%.min.js:: Makefile
rm -f $@
$(JS_COMPILER) nv.d3.js >> $@
clean:
rm -rf nv.d3.js nv.d3.min.js
%.min.css:: Makefile
rm -f $@
$(CSS_COMPILER) nv.d3.css >> $@
clean:
rm -rf nv.d3.js nv.d3.min.js nv.d3.css nv.d3.min.css

@ -58,23 +58,21 @@ We are currently changing our branch structure so that master will be gauranteed
---
Minifying your fork:
## Minifying your fork:
The Makefile requires [UglifyJS](https://github.com/mishoo/UglifyJS).
### Using Make
The Makefile requires [UglifyJS](https://github.com/mishoo/UglifyJS) and [CSSMin](https://github.com/jbleuzen/node-cssmin)
The easiest way to install is to install via npm. Run `npm install
uglify-js` from your home directory, then add the output from `npm bin`
into your path so that you have access to `uglifyjs` from the command
line (remember to restart your terminal window when adding to the path.)
The easiest way to install UglifyJS and CSSMin is via npm. Run `npm install -g uglify-js cssmin`. After installing verify the setup by running `uglifyjs --version` and `cssmin --help`.
Once you have `uglifyjs` command available, running `make` from your
Once you have the `uglifyjs` and `cssmin` commands available, running `make` from your
fork's root directory will rebuild both `nv.d3.js` and `nv.d3.min.js`.
Without UglifyJS, you won't get the minified version when running make.
Without UglifyJS of CSSMin, you won't get the minified versions when running make.
## use grunt
### Using Grunt
You can use grunt insteadof makefile to build js file. See more about [grunt](http://gruntjs.com/).
You can use grunt instead of makefile to build js file. See more about [grunt](http://gruntjs.com/).
***[Nodejs](http://nodejs.org/) must be installed before you can use grunt.***
Run `npm install` in root dir to install grunt and it's dependencies.

3702
nv.d3.js

File diff suppressed because it is too large Load Diff

2
nv.d3.min.css vendored

File diff suppressed because one or more lines are too long

14
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save