diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..3af2cc6ef --- /dev/null +++ b/.babelrc @@ -0,0 +1,9 @@ +{ + "presets": [ + ["env", { + "targets": { + "browsers": ["last 2 versions", "safari >= 10", "IE 11"] + } + }] + ] +} diff --git a/.gitignore b/.gitignore index 844a0fefb..18faebff0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ inverse-analytics.js .idea eggs .Python +build dev-jc.html inverse-dev.html diff --git a/package.json b/package.json index c3d04e1cc..82960a821 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,9 @@ "devDependencies": { "almond": "~0.3.3", "awesomplete": "^1.1.1", + "babel-cli": "^6.18.0", + "babel-preset-env": "^1.5.2", + "babel-preset-latest": "^6.16.0", "backbone": "1.3.3", "backbone.browserStorage": "0.0.3", "backbone.overview": "0.0.3", @@ -64,6 +67,7 @@ "pluggable.js": "https://github.com/jcbrand/pluggable.js.git#8f8c8235816f44cda0f855d6ca879445aaa486a1", "po2json": "^0.4.4", "requirejs": "2.3.3", + "requirejs-babel": "0.0.9", "run-headless-chromium": "^0.1.1", "sinon": "^2.1.0", "snyk": "^1.21.2", diff --git a/src/config.js b/src/config.js index a27bb2dec..7e4054fee 100644 --- a/src/config.js +++ b/src/config.js @@ -17,10 +17,12 @@ require.config({ paths: { "almond": "node_modules/almond/almond", "awesomplete": "node_modules/awesomplete/awesomplete", + "babel": "node_modules/requirejs-babel/babel-5.8.34.min", "backbone": "node_modules/backbone/backbone", "backbone.noconflict": "src/backbone.noconflict", "backbone.browserStorage": "node_modules/backbone.browserStorage/backbone.browserStorage", "backbone.overview": "node_modules/backbone.overview/backbone.overview", + "es6": "node_modules/requirejs-babel/es6", "eventemitter": "node_modules/otr/build/dep/eventemitter", "es6-promise": "node_modules/es6-promise/dist/es6-promise", "jquery": "node_modules/jquery/dist/jquery",