Ver código fonte

added back babel-polyfill

sanex3339 9 anos atrás
pai
commit
13d64a387d
5 arquivos alterados com 10 adições e 6 exclusões
  1. 4 1
      .babelrc
  2. 0 4
      index.ts
  3. 1 0
      package.json
  4. 1 1
      scripts/test-compile
  5. 4 0
      src/JavaScriptObfuscator.ts

+ 4 - 1
.babelrc

@@ -1,4 +1,7 @@
 {
   "presets": ["es2015"],
-  "plugins": ["transform-object-assign"]
+  "plugins": [
+    "transform-array-from",
+    "transform-object-assign"
+  ]
 }

+ 0 - 4
index.ts

@@ -2,8 +2,4 @@
 
 import { JavaScriptObfuscator } from './src/JavaScriptObfuscator';
 
-if (!(<any>global)._babelPolyfill) {
-    require('babel-polyfill');
-}
-
 module.exports = JavaScriptObfuscator;

+ 1 - 0
package.json

@@ -28,6 +28,7 @@
   "devDependencies": {
     "babel-cli": "^6.9.0",
     "babel-loader": "^6.2.4",
+    "babel-plugin-transform-array-from": "^1.0.0",
     "babel-plugin-transform-object-assign": "^6.8.0",
     "babel-preset-es2015": "^6.9.0",
     "chai": "^3.5.0",

+ 1 - 1
scripts/test-compile

@@ -1,4 +1,4 @@
 #!/bin/bash
 
 $(npm bin)/tsc -p tsconfig-test.json
-$(npm bin)/babel test-tmp --out-dir test-tmp --source-maps --presets es2015 --plugins transform-object-assign
+$(npm bin)/babel test-tmp --out-dir test-tmp --source-maps --presets es2015 --plugins transform-array-from,transform-object-assign

+ 4 - 0
src/JavaScriptObfuscator.ts

@@ -12,6 +12,10 @@ import { JavaScriptObfuscatorCLI } from "./cli/JavaScriptObfuscatorCLI";
 import { Obfuscator } from "./Obfuscator";
 import { Options } from "./Options";
 
+if (!(<any>global)._babelPolyfill) {
+    require('babel-polyfill');
+}
+
 export class JavaScriptObfuscator {
     /**
      * @type {GenerateOptions}