Skip to content

Commit

Permalink
Merge pull request novus#306 from davejlong/master
Browse files Browse the repository at this point in the history
Update bower.json
  • Loading branch information
twolfnovus committed Oct 17, 2013
2 parents 13d5dec + 97779ba commit 2185020
Show file tree
Hide file tree
Showing 9 changed files with 881 additions and 80 deletions.
22 changes: 19 additions & 3 deletions GruntFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,31 @@ module.exports = function(grunt) {
tasks: ['concat']
}
},

copy: {
css: {
files: [
{ src: 'src/nv.d3.css', dest: 'nv.d3.css' }
]
}
},
cssmin: {
dist: {
files: {
'nv.d3.min.css' : ['nv.d3.css']
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');

grunt.registerTask('default', ['concat']);
grunt.registerTask('production', ['concat', 'uglify']);
grunt.registerTask('default', ['concat', 'copy']);
grunt.registerTask('production', ['concat', 'uglify', 'copy', 'cssmin']);
grunt.registerTask('release', ['production']);
grunt.registerTask('lint', ['jshint']);
};
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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*.css
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,29 @@ 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.
make # build nv.d3.js and nv.d3.css and minify
make nv.d3.js # Build nv.d3.js
make nv.d3.min.js # Minify nv.d3.js into nv.d3.min.js
make nv.d3.css # Build nv.d3.css
make nv.d3.min.css # Minify nv.d3.css into nv.d3.min.css
make clean # Delete nv.d3.*js and nv.d3.*css

## use grunt

You can use grunt insteadof makefile to build js file. See more about [grunt](http://gruntjs.com/).
*Without UglifyJS of CSSMin, you won't get the minified versions when running make.**

### Using Grunt

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.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nvd3",
"version": "1.1.12-beta",
"version": "1.1.13-beta",
"homepage": "http://www.nvd3.org",
"authors": [
"Bob Monteverde",
Expand Down
Loading

0 comments on commit 2185020

Please sign in to comment.