Преглед на файлове

Some structure changes related to configs

sanex3339 преди 7 години
родител
ревизия
85672b5537

+ 1 - 1
CHANGELOG.md

@@ -2,7 +2,7 @@ Change Log
 ===
 v0.17.0
 ---
-* **Web version**: Added web version dist
+* **Browser version**: Added browser version dist
 * Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/252
 * Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/247
 

+ 1 - 1
README.md

@@ -67,7 +67,7 @@ $ npm install --save-dev javascript-obfuscator
 Add `<script>` tag with package:
 
 ```html
-<script src="./node_modules/javascript-obfuscator/dist/index.web.js">
+<script src="./node_modules/javascript-obfuscator/dist/index.browser.js">
 ```
 
 or require package from CDN:

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
dist/index.browser.js


+ 1 - 1
scripts/test-compile

@@ -1,5 +1,5 @@
 #!/bin/bash
 
-$(yarn bin)/tsc -p tsconfig.test.json &&
+$(yarn bin)/tsc -p test/tsconfig.test.json &&
 $(yarn bin)/babel test-tmp --out-dir test-tmp --source-maps inline &&
 rsync -a --prune-empty-dirs --include '*/' --include '*.js' --include '*.json' --exclude '*' test/ test-tmp/test/

+ 1 - 1
scripts/tslint

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-$(yarn bin)/tslint src/**/*.ts --project tsconfig.json
+$(yarn bin)/tslint src/**/*.ts --project src/tsconfig.node.json

+ 1 - 1
scripts/watch

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-$(yarn bin)/webpack --config webpack/webpack.config.js --mode development --watch
+$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode development --watch

+ 1 - 1
scripts/webpack-dev

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-$(yarn bin)/webpack --config webpack/webpack.config.js --mode production
+$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode production

+ 1 - 1
scripts/webpack-prod

@@ -1,3 +1,3 @@
 #!/bin/bash
 
-$(yarn bin)/webpack --config webpack/webpack.config.js --config webpack/webpack.web.config.js --mode production
+$(yarn bin)/webpack --config webpack/webpack.node.config.js --config webpack/webpack.browser.config.js --mode production

+ 9 - 0
src/tsconfig.browser.json

@@ -0,0 +1,9 @@
+{
+  "extends": "../tsconfig.json",
+  "compilerOptions": {
+    "sourceMap": true,
+  },
+  "exclude": [
+    "../test"
+  ]
+}

+ 17 - 0
src/tsconfig.node.json

@@ -0,0 +1,17 @@
+{
+  "extends": "../tsconfig.json",
+  "compilerOptions": {
+    "importHelpers": true,
+    "noEmitHelpers": true,
+    "sourceMap": true,
+    "plugins": [
+      {
+        "name": "tslint-language-service",
+        "ignoreDefinitionFiles": true
+      }
+    ]
+  },
+  "exclude": [
+    "../test"
+  ]
+}

+ 14 - 0
test/tsconfig.test.json

@@ -0,0 +1,14 @@
+{
+  "extends": "../tsconfig.json",
+  "compilerOptions": {
+    "outDir": "../test-tmp",
+    "noEmitHelpers": true,
+    "importHelpers": true,
+    "inlineSourceMap": true,
+    "inlineSources": true,
+    "noImplicitAny": true,
+  },
+  "include": [
+    "../**/*"
+  ]
+}

+ 3 - 13
tsconfig.json

@@ -2,30 +2,20 @@
   "compilerOptions": {
     "emitDecoratorMetadata": true,
     "experimentalDecorators": true,
-    "importHelpers": true,
     "lib": [
       "es2017",
       "dom"
     ],
+    "target": "es2017",
     "module": "commonjs",
     "esModuleInterop": true,
-    "noEmitHelpers": true,
     "noImplicitThis": false,
     "noUnusedLocals": true,
     "removeComments": true,
-    "sourceMap": true,
-    "strict": true,
-    "target": "es2017",
-    "plugins": [
-      {
-        "name": "tslint-language-service",
-        "ignoreDefinitionFiles": true
-      }
-    ]
+    "strict": true
   },
   "exclude": [
-    "node_modules",
-    "test"
+    "node_modules"
   ],
   "compileOnSave": false,
   "buildOnSave": false

+ 0 - 25
tsconfig.test.json

@@ -1,25 +0,0 @@
-{
-  "compilerOptions": {
-    "outDir": "test-tmp",
-    "target": "es2017",
-    "lib": [
-      "es2017",
-      "dom"
-    ],
-    "noEmitHelpers": true,
-    "importHelpers": true,
-    "module": "commonjs",
-    "esModuleInterop": true,
-    "inlineSourceMap": true,
-    "inlineSources": true,
-    "emitDecoratorMetadata": true,
-    "experimentalDecorators": true,
-    "removeComments": true,
-    "noImplicitAny": true,
-    "strictNullChecks": true,
-    "noUnusedLocals": true
-  },
-  "exclude": [
-    "node_modules"
-  ]
-}

+ 0 - 24
tsconfig.web.json

@@ -1,24 +0,0 @@
-{
-  "compilerOptions": {
-    "emitDecoratorMetadata": true,
-    "experimentalDecorators": true,
-    "lib": [
-      "es2017",
-      "dom"
-    ],
-    "module": "commonjs",
-    "esModuleInterop": true,
-    "noImplicitThis": false,
-    "noUnusedLocals": true,
-    "removeComments": true,
-    "sourceMap": true,
-    "strict": true,
-    "target": "es2017"
-  },
-  "exclude": [
-    "node_modules",
-    "test"
-  ],
-  "compileOnSave": false,
-  "buildOnSave": false
-}

+ 3 - 3
webpack/webpack.web.config.js → webpack/webpack.browser.config.js

@@ -18,11 +18,11 @@ module.exports = {
                 test: /\.ts(x?)$/,
                 loader: 'awesome-typescript-loader',
                 query: {
+                    configFileName: 'src/tsconfig.browser.json',
                     useBabel: true,
                     babelCore: '@babel/core',
                     useCache: true,
-                    forceIsolatedModules: true,
-                    configFileName: 'tsconfig.web.json'
+                    forceIsolatedModules: true
                 }
             }
         ]
@@ -45,7 +45,7 @@ module.exports = {
     output: {
         libraryTarget: 'var',
         library: 'JavaScriptObfuscator',
-        filename: 'index.web.js'
+        filename: 'index.browser.js'
     },
     performance: {
         hints: false

+ 2 - 1
webpack/webpack.config.js → webpack/webpack.node.config.js

@@ -23,6 +23,7 @@ module.exports = {
                 test: /\.ts(x?)$/,
                 loader: 'awesome-typescript-loader',
                 query: {
+                    configFileName: 'src/tsconfig.node.json',
                     useBabel: true,
                     babelCore: '@babel/core',
                     useCache: true,
@@ -51,7 +52,7 @@ module.exports = {
         new CheckerPlugin(),
         new TSLintPlugin({
             files: ['./src/**/*.ts'],
-            project: './tsconfig.json',
+            project: './src/tsconfig.node.json',
             exclude: []
         })
     ],

Някои файлове не бяха показани, защото твърде много файлове са промени