Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
Build dist/gherkin.min.js ref #9
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Apr 2, 2015
1 parent f04bfc6 commit 1e2d4bf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ all: .compared
.compared: .built $(TOKENS) $(ASTS) $(ERRORS)
touch $@

.built: lib/gherkin/parser.js lib/gherkin/dialects.json $(JAVASCRIPT_FILES) dist/gherkin.js node_modules
.built: lib/gherkin/parser.js lib/gherkin/dialects.json $(JAVASCRIPT_FILES) dist/gherkin.js dist/gherkin.min.js node_modules/.fetched
./node_modules/.bin/mocha
touch $@

node_modules: package.json
node_modules/.fetched: package.json
npm install
touch $@

acceptance/testdata/%.feature.tokens: ../testdata/%.feature ../testdata/%.feature.tokens .built
mkdir -p `dirname $@`
Expand Down Expand Up @@ -54,6 +55,13 @@ dist/gherkin.js: lib/gherkin/parser.js ../LICENSE
echo '*/' >> $@
./node_modules/.bin/browserify index.js --ignore-missing >> $@

dist/gherkin.min.js: dist/gherkin.js
mkdir -p `dirname $@`
echo '/*' > $@
cat ../LICENSE >> $@
echo '*/' >> $@
./node_modules/.bin/uglifyjs $^ >> $@

clean:
rm -rf .compared .built acceptance lib/gherkin/parser.js lib/gherkin/dialects.json dist
.PHONY: clean
2 changes: 1 addition & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<textarea id="input" cols="30" rows="10">Feature: Hello</textarea>
<br>
<pre id="output"></pre>
<script src="../dist/gherkin.js"></script>
<script src="../dist/gherkin.min.js"></script>
<script src="demo.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"homepage": "https://github.com/cucumber/gherkin3",
"devDependencies": {
"browserify": "^9.0.3",
"mocha": "^2.1.0"
"mocha": "^2.1.0",
"uglify-js": "^2.4.19"
},
"dependencies": {
"tea-error": "^0.1.0"
Expand Down

0 comments on commit 1e2d4bf

Please sign in to comment.