Browse Source

Pass the browser version through Babel

This will allow to use ES2015 constructs in PEG.js code.

See #442.
redux
David Majda 7 years ago
parent
commit
4e38617748
  1. 5
      Makefile
  2. 2
      package.json

5
Makefile

@ -74,7 +74,10 @@ browser:
echo ' * Licensed under the MIT license.' >> $(BROWSER_FILE_DEV)
echo ' */' >> $(BROWSER_FILE_DEV)
$(BROWSERIFY) --standalone peg $(MAIN_FILE) >> $(BROWSER_FILE_DEV)
$(BROWSERIFY) \
--standalone peg \
--transform [ babelify --presets [ es2015 ] --compact false ] \
$(MAIN_FILE) >> $(BROWSER_FILE_DEV)
$(UGLIFYJS) \
--mangle \

2
package.json

@ -48,6 +48,8 @@
"test": "make lint && make spec"
},
"devDependencies": {
"babel-preset-es2015": "6.14.0",
"babelify": "7.3.0",
"browserify": "13.1.0",
"eslint": "2.13.1",
"http-server": "0.9.0",

Loading…
Cancel
Save