Skip to content

Commit

Permalink
Include minified version and script to generate.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Nov 21, 2017
1 parent 183d886 commit b7dfe06
Show file tree
Hide file tree
Showing 5 changed files with 1,995 additions and 6 deletions.
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ifeq ($(OS),Windows_NT)
OPEN := start
else
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
OPEN := xdg-open
endif
ifeq ($(UNAME),Darwin)
OPEN := open
endif
endif

COMPILER := $(shell command -v closure-compiler 2> /dev/null)

.PHONY: demo test dist

demo:
$(OPEN) demo/index.html

test:
$(OPEN) test/SpecRunner.html

SOURCE := src/jquery.multi-select.js
DEST := src/jquery.multi-select.min.js

dist:
ifndef COMPILER
$(error "closure-compiler is not available, please install it")
endif
@echo "Before"
wc -c $(DEST) && gzip -c $(DEST) | wc -c
$(COMPILER) --externs externs/jquery-1.9.js -O ADVANCED --rewrite_polyfills=false $(SOURCE) > $(DEST)
@echo "After"
wc -c $(DEST) && gzip -c $(DEST) | wc -c
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@ You can pass a number of options into `.multiSelect()` to customise the HTML out

## See a demo

Open `demo/index.html` in your web browser.
Run `make demo`, or open `demo/index.html` in your web browser.

## Run the tests

Open `test/SpecRunner.html` in your web browser.
Run `make test`, or open `test/SpecRunner.html` in your web browser.

## Compile minimized version

You'll need the Closure Compiler, which you can get with `brew install
closure-compiler` or directly from Google's website. If you use brew
(or otherwise create a closure-compiler script in your PATH), you can
run `make dist`, or otherwise you can run:
`make dist COMPILER='java -jar path-to-compiler.jar'`.
Loading

0 comments on commit b7dfe06

Please sign in to comment.