Skip to content

Commit

Permalink
chore: v3 (support next v14) (#22)
Browse files Browse the repository at this point in the history
* chore: v3 (support next v14)

* v3 beta

* v3

* v3

* fix typo

* improve
  • Loading branch information
mtripg6666tdr authored Nov 20, 2023
1 parent 6752d2a commit ae6ab5b
Show file tree
Hide file tree
Showing 11 changed files with 2,513 additions and 1,568 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules
*node_modules
index.js
loader.js
loader.d.ts
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# javascript-obfuscator plugin v2 for Next.js
# javascript-obfuscator plugin for Next.js
[![npm](https://img.shields.io/npm/v/nextjs-obfuscator)](https://www.npmjs.com/package/nextjs-obfuscator)

The `nextjs-obfuscator` enables you to make your Next.js app difficult to be reverse-engineered, using [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator).

### ℹ️ If you are looking for README for v1, see [here](https://github.com/mtripg6666tdr/nextjs-obfuscator/tree/v1#readme).

There are some useful notes:
- The app router is supported.
- Building by turbopack is currently NOT supported.
- Minimum supported Next.js version is v13.

## Installation
You have to install javascript-obfuscator separately.

Expand Down
206 changes: 106 additions & 100 deletions example/app-router/.pnp.cjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions example/app-router/.yarn/sdks/typescript/lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/typescript.js
// Setup the environment to be able to require typescript
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/lib/typescript.js your application uses
module.exports = absRequire(`typescript/lib/typescript.js`);
// Defer to the real typescript your application uses
module.exports = absRequire(`typescript`);
8 changes: 6 additions & 2 deletions example/app-router/.yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "typescript",
"version": "5.1.3-sdk",
"version": "5.2.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
"type": "commonjs",
"bin": {
"tsc": "./bin/tsc",
"tsserver": "./bin/tsserver"
}
}
12 changes: 7 additions & 5 deletions example/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"lint": "next lint"
},
"dependencies": {
"@types/node": "20.3.1",
"@types/react": "18.2.13",
"@types/react-dom": "18.2.6",
"next": "13.4.6",
"next": "14.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "5.1.3"
"typescript": "5.2.2"
},
"devDependencies": {
"@types/node": "20.9.2",
"@types/react": "18.2.37",
"@types/react-dom": "^18.2.15"
},
"packageManager": "yarn@3.6.0"
}
Loading

0 comments on commit ae6ab5b

Please sign in to comment.