Browse Source

use babel

master
isymchych 9 years ago
parent
commit
ff6ec2ec6b
3 changed files with 14 additions and 3 deletions
  1. 2
    1
      .jshintrc
  2. 1
    0
      app.js
  3. 11
    2
      package.json

+ 2
- 1
.jshintrc View File

15
     "newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()`
15
     "newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()`
16
     "maxlen": 80, // {int} Max number of characters per line
16
     "maxlen": 80, // {int} Max number of characters per line
17
     "latedef": false, //This option prohibits the use of a variable before it was defined
17
     "latedef": false, //This option prohibits the use of a variable before it was defined
18
-    "laxbreak": true //Ignore line breaks around "=", "==", "&&", etc.
18
+    "laxbreak": true, //Ignore line breaks around "=", "==", "&&", etc.
19
+    "esnext": true //support ES2015
19
 }
20
 }

+ 1
- 0
app.js View File

1
 /* global $, JitsiMeetJS, config, Promise */
1
 /* global $, JitsiMeetJS, config, Promise */
2
 /* application specific logic */
2
 /* application specific logic */
3
 
3
 
4
+import "babel-polyfill";
4
 require("jquery");
5
 require("jquery");
5
 require("jquery-ui");
6
 require("jquery-ui");
6
 require("strophe");
7
 require("strophe");

+ 11
- 2
package.json View File

42
     "jshint": "2.8.0",
42
     "jshint": "2.8.0",
43
     "precommit-hook": "3.0.0",
43
     "precommit-hook": "3.0.0",
44
     "uglify-js": "2.4.24",
44
     "uglify-js": "2.4.24",
45
-    "clean-css": "*"
45
+    "clean-css": "*",
46
+    "babelify": "*",
47
+    "babel-preset-es2015": "*",
48
+    "babel-polyfill": "*"
46
   },
49
   },
47
   "license": "Apache-2.0",
50
   "license": "Apache-2.0",
48
   "scripts": {
51
   "scripts": {
54
   ],
57
   ],
55
   "browserify": {
58
   "browserify": {
56
     "transform": [
59
     "transform": [
57
-      "browserify-shim"
60
+      "browserify-shim",
61
+      ["babelify", {
62
+        "ignore": "node_modules"
63
+      }]
58
     ]
64
     ]
59
   },
65
   },
66
+  "babel": {
67
+    "presets": ["es2015"]
68
+  },
60
   "browser": {
69
   "browser": {
61
     "jquery": "./node_modules/jquery/dist/jquery.js",
70
     "jquery": "./node_modules/jquery/dist/jquery.js",
62
     "jquery-ui": "./node_modules/jquery-ui/jquery-ui.js",
71
     "jquery-ui": "./node_modules/jquery-ui/jquery-ui.js",

Loading…
Cancel
Save