瀏覽代碼

use babel

master
isymchych 9 年之前
父節點
當前提交
ff6ec2ec6b
共有 3 個文件被更改,包括 14 次插入3 次删除
  1. 2
    1
      .jshintrc
  2. 1
    0
      app.js
  3. 11
    2
      package.json

+ 2
- 1
.jshintrc 查看文件

@@ -15,5 +15,6 @@
15 15
     "newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()`
16 16
     "maxlen": 80, // {int} Max number of characters per line
17 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 查看文件

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

+ 11
- 2
package.json 查看文件

@@ -42,7 +42,10 @@
42 42
     "jshint": "2.8.0",
43 43
     "precommit-hook": "3.0.0",
44 44
     "uglify-js": "2.4.24",
45
-    "clean-css": "*"
45
+    "clean-css": "*",
46
+    "babelify": "*",
47
+    "babel-preset-es2015": "*",
48
+    "babel-polyfill": "*"
46 49
   },
47 50
   "license": "Apache-2.0",
48 51
   "scripts": {
@@ -54,9 +57,15 @@
54 57
   ],
55 58
   "browserify": {
56 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 69
   "browser": {
61 70
     "jquery": "./node_modules/jquery/dist/jquery.js",
62 71
     "jquery-ui": "./node_modules/jquery-ui/jquery-ui.js",

Loading…
取消
儲存