Add Makefile for building web assets

This commit is contained in:
Winston Chang
2013-04-24 12:29:46 -05:00
parent 96c7df5afa
commit 8f65156bda
4 changed files with 40 additions and 0 deletions

View File

@@ -8,3 +8,4 @@
^run\.R$
^\.gitignore$
^res$
^tools$

2
tools/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules/

17
tools/Makefile Normal file
View File

@@ -0,0 +1,17 @@
UGLIFY = ./node_modules/.bin/uglifyjs
# Directory of bootstrap datepicker
DATEPICKER = ../inst/www/shared/datepicker/js/
all: $(DATEPICKER)/bootstrap-datepicker.min.js
clean:
rm -f $(DATEPICKER)/bootstrap-datepicker.min.js
$(DATEPICKER)/bootstrap-datepicker.min.js: $(DATEPICKER)/bootstrap-datepicker.js \
$(wildcard $(DATEPICKER)/locales/bootstrap-datepicker.*.js)
$(UGLIFY) \
$(DATEPICKER)/bootstrap-datepicker.js \
$(DATEPICKER)/locales/bootstrap-datepicker.*.js \
--output $(DATEPICKER)/bootstrap-datepicker.min.js

20
tools/README.md Normal file
View File

@@ -0,0 +1,20 @@
The contents in this subdirectory are used for building web assets.
To build, install the requirements (below), then go to this directory and run:
```
make
```
## Requirements
### UglifyJS
UglifyJS is a module for node.js which minifies Javascript files. It should be
installed with the following command (run from this directory):
```
npm install uglify-js
```
This will install the UglifyJS into `./node_modules/`.