Skip to content

Commit

Permalink
Some structure changes related to configs
Browse files Browse the repository at this point in the history
  • Loading branch information
sanex3339 committed Apr 19, 2018
1 parent cedc54f commit 85672b5
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 74 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion dist/index.web.js → dist/index.browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/test-compile
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion scripts/tslint
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

$(yarn bin)/tslint src/**/*.ts --project tsconfig.json
$(yarn bin)/tslint src/**/*.ts --project src/tsconfig.node.json
2 changes: 1 addition & 1 deletion scripts/watch
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/webpack-dev
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/webpack-prod
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions src/tsconfig.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"sourceMap": true,
},
"exclude": [
"../test"
]
}
17 changes: 17 additions & 0 deletions src/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"importHelpers": true,
"noEmitHelpers": true,
"sourceMap": true,
"plugins": [
{
"name": "tslint-language-service",
"ignoreDefinitionFiles": true
}
]
},
"exclude": [
"../test"
]
}
14 changes: 14 additions & 0 deletions test/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../test-tmp",
"noEmitHelpers": true,
"importHelpers": true,
"inlineSourceMap": true,
"inlineSources": true,
"noImplicitAny": true,
},
"include": [
"../**/*"
]
}
16 changes: 3 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 0 additions & 25 deletions tsconfig.test.json

This file was deleted.

24 changes: 0 additions & 24 deletions tsconfig.web.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
]
Expand All @@ -45,7 +45,7 @@ module.exports = {
output: {
libraryTarget: 'var',
library: 'JavaScriptObfuscator',
filename: 'index.web.js'
filename: 'index.browser.js'
},
performance: {
hints: false
Expand Down
3 changes: 2 additions & 1 deletion webpack/webpack.config.js → webpack/webpack.node.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -51,7 +52,7 @@ module.exports = {
new CheckerPlugin(),
new TSLintPlugin({
files: ['./src/**/*.ts'],
project: './tsconfig.json',
project: './src/tsconfig.node.json',
exclude: []
})
],
Expand Down

0 comments on commit 85672b5

Please sign in to comment.