Skip to content

Commit 85672b5

Browse files
committed
Some structure changes related to configs
1 parent cedc54f commit 85672b5

16 files changed

+56
-74
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Change Log
22
===
33
v0.17.0
44
---
5-
* **Web version**: Added web version dist
5+
* **Browser version**: Added browser version dist
66
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/252
77
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/247
88

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ $ npm install --save-dev javascript-obfuscator
6767
Add `<script>` tag with package:
6868

6969
```html
70-
<script src="./node_modules/javascript-obfuscator/dist/index.web.js">
70+
<script src="./node_modules/javascript-obfuscator/dist/index.browser.js">
7171
```
7272
7373
or require package from CDN:

dist/index.web.js dist/index.browser.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/test-compile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
$(yarn bin)/tsc -p tsconfig.test.json &&
3+
$(yarn bin)/tsc -p test/tsconfig.test.json &&
44
$(yarn bin)/babel test-tmp --out-dir test-tmp --source-maps inline &&
55
rsync -a --prune-empty-dirs --include '*/' --include '*.js' --include '*.json' --exclude '*' test/ test-tmp/test/

scripts/tslint

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
$(yarn bin)/tslint src/**/*.ts --project tsconfig.json
3+
$(yarn bin)/tslint src/**/*.ts --project src/tsconfig.node.json

scripts/watch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
$(yarn bin)/webpack --config webpack/webpack.config.js --mode development --watch
3+
$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode development --watch

scripts/webpack-dev

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
$(yarn bin)/webpack --config webpack/webpack.config.js --mode production
3+
$(yarn bin)/webpack --config webpack/webpack.node.config.js --mode production

scripts/webpack-prod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
$(yarn bin)/webpack --config webpack/webpack.config.js --config webpack/webpack.web.config.js --mode production
3+
$(yarn bin)/webpack --config webpack/webpack.node.config.js --config webpack/webpack.browser.config.js --mode production

src/tsconfig.browser.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"sourceMap": true,
5+
},
6+
"exclude": [
7+
"../test"
8+
]
9+
}

src/tsconfig.node.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"importHelpers": true,
5+
"noEmitHelpers": true,
6+
"sourceMap": true,
7+
"plugins": [
8+
{
9+
"name": "tslint-language-service",
10+
"ignoreDefinitionFiles": true
11+
}
12+
]
13+
},
14+
"exclude": [
15+
"../test"
16+
]
17+
}

test/tsconfig.test.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../test-tmp",
5+
"noEmitHelpers": true,
6+
"importHelpers": true,
7+
"inlineSourceMap": true,
8+
"inlineSources": true,
9+
"noImplicitAny": true,
10+
},
11+
"include": [
12+
"../**/*"
13+
]
14+
}

tsconfig.json

+3-13
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,20 @@
22
"compilerOptions": {
33
"emitDecoratorMetadata": true,
44
"experimentalDecorators": true,
5-
"importHelpers": true,
65
"lib": [
76
"es2017",
87
"dom"
98
],
9+
"target": "es2017",
1010
"module": "commonjs",
1111
"esModuleInterop": true,
12-
"noEmitHelpers": true,
1312
"noImplicitThis": false,
1413
"noUnusedLocals": true,
1514
"removeComments": true,
16-
"sourceMap": true,
17-
"strict": true,
18-
"target": "es2017",
19-
"plugins": [
20-
{
21-
"name": "tslint-language-service",
22-
"ignoreDefinitionFiles": true
23-
}
24-
]
15+
"strict": true
2516
},
2617
"exclude": [
27-
"node_modules",
28-
"test"
18+
"node_modules"
2919
],
3020
"compileOnSave": false,
3121
"buildOnSave": false

tsconfig.test.json

-25
This file was deleted.

tsconfig.web.json

-24
This file was deleted.

webpack/webpack.web.config.js webpack/webpack.browser.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ module.exports = {
1818
test: /\.ts(x?)$/,
1919
loader: 'awesome-typescript-loader',
2020
query: {
21+
configFileName: 'src/tsconfig.browser.json',
2122
useBabel: true,
2223
babelCore: '@babel/core',
2324
useCache: true,
24-
forceIsolatedModules: true,
25-
configFileName: 'tsconfig.web.json'
25+
forceIsolatedModules: true
2626
}
2727
}
2828
]
@@ -45,7 +45,7 @@ module.exports = {
4545
output: {
4646
libraryTarget: 'var',
4747
library: 'JavaScriptObfuscator',
48-
filename: 'index.web.js'
48+
filename: 'index.browser.js'
4949
},
5050
performance: {
5151
hints: false

webpack/webpack.config.js webpack/webpack.node.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports = {
2323
test: /\.ts(x?)$/,
2424
loader: 'awesome-typescript-loader',
2525
query: {
26+
configFileName: 'src/tsconfig.node.json',
2627
useBabel: true,
2728
babelCore: '@babel/core',
2829
useCache: true,
@@ -51,7 +52,7 @@ module.exports = {
5152
new CheckerPlugin(),
5253
new TSLintPlugin({
5354
files: ['./src/**/*.ts'],
54-
project: './tsconfig.json',
55+
project: './src/tsconfig.node.json',
5556
exclude: []
5657
})
5758
],

0 commit comments

Comments
 (0)