@afterpack/esbuild 0.2.6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -6
- package/dist/index.cjs +1 -0
- package/dist/index.js +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -37,8 +37,8 @@ them there. If that matters to you, use a bundler with an in-memory plugin, such
|
|
|
37
37
|
Each build writes a protection receipt to `.afterpack/receipts/`, one per output directory
|
|
38
38
|
(`.afterpack/receipts/dist.json` for `dist`). `.afterpack/` sits next to your project's lockfile,
|
|
39
39
|
`afterpack.json` or `.git` (failing those, its `package.json`), otherwise beside the build
|
|
40
|
-
directory, so the receipt never ships with your build. Run `npx afterpack verify dist` in
|
|
41
|
-
deploy step to check that what you ship is what was obfuscated.
|
|
40
|
+
directory, so the receipt never ships with your build. Run `npx afterpack@latest verify dist` in
|
|
41
|
+
your deploy step to check that what you ship is what was obfuscated.
|
|
42
42
|
|
|
43
43
|
## Options
|
|
44
44
|
|
|
@@ -53,7 +53,7 @@ afterpackEsbuild({ preset: "hard", seed: "git" });
|
|
|
53
53
|
| [`identifiers.reserved`][identifiers.reserved] | names never to rename | none |
|
|
54
54
|
| [`paths.exclude`][paths.exclude] | globs for files to leave untouched | none |
|
|
55
55
|
| [`sourceMap.enabled`][sourceMap.enabled] | write source maps for the obfuscated output | off; on in development mode (`build.mode` or `NODE_ENV=development`) when esbuild emits a map |
|
|
56
|
-
| [`protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when esbuild's `sourcemap` is set |
|
|
56
|
+
| [`protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when esbuild's `sourcemap` is set, outside CI |
|
|
57
57
|
| [`build.autorun`][build.autorun] | `false` turns AfterPack off | `true` |
|
|
58
58
|
|
|
59
59
|
Dotted names are nested objects: `sourceMap.enabled` is `{ sourceMap: { enabled: true } }`. Every
|
|
@@ -72,9 +72,11 @@ a region are a [Pro](https://www.afterpack.dev/docs/pro) feature. They need esbu
|
|
|
72
72
|
`sourcemap: true`, since they are read back from the source map. Without it, the plugin skips them
|
|
73
73
|
and tells you.
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
When esbuild's `sourcemap` is set, the
|
|
76
|
+
[Protection Map](https://www.afterpack.dev/docs/protection-map) is written to `.afterpack/`, which
|
|
77
|
+
carries its own `.gitignore` and self-ignores. Without source maps, or in CI, it is off unless
|
|
78
|
+
`protectionMap.enabled` is `true`. The Protection Map and any backups contain your original source,
|
|
79
|
+
so never deploy or commit them.
|
|
78
80
|
|
|
79
81
|
Options can also live in `afterpack.json` or in `AFTERPACK_*` environment variables. The options
|
|
80
82
|
object wins over the environment, which wins over the file. An unknown or misspelled key fails the
|
package/dist/index.cjs
CHANGED
|
@@ -112,6 +112,7 @@ function afterpackEsbuild(options = {}) {
|
|
|
112
112
|
...(0, __afterpack_integration_utils.passSettings)(resolved),
|
|
113
113
|
sourceType: (0, __afterpack_integration_utils.sourceTypeForOutputFormat)(io.format),
|
|
114
114
|
hasBundlerSourcemap: Boolean(io.sourcemap),
|
|
115
|
+
receipt: { bundler: "esbuild" },
|
|
115
116
|
postMinify: POST_MINIFY_DIRECTIVE_RECOVERY,
|
|
116
117
|
messages: {
|
|
117
118
|
autoEnableBundlerSourcemap: "protectionMap:true but no bundler sourcemap was found; set `sourcemap: true` so future builds can render original source in the map.",
|
package/dist/index.js
CHANGED
|
@@ -89,6 +89,7 @@ function afterpackEsbuild(options = {}) {
|
|
|
89
89
|
...passSettings(resolved),
|
|
90
90
|
sourceType: sourceTypeForOutputFormat(io.format),
|
|
91
91
|
hasBundlerSourcemap: Boolean(io.sourcemap),
|
|
92
|
+
receipt: { bundler: "esbuild" },
|
|
92
93
|
postMinify: POST_MINIFY_DIRECTIVE_RECOVERY,
|
|
93
94
|
messages: {
|
|
94
95
|
autoEnableBundlerSourcemap: "protectionMap:true but no bundler sourcemap was found; set `sourcemap: true` so future builds can render original source in the map.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afterpack/esbuild",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "esbuild plugin for AfterPack: obfuscate your JavaScript output when the esbuild build finishes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"esbuild": ">=0.17.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@afterpack/core": "~0.
|
|
32
|
-
"@afterpack/integration-utils": "0.
|
|
31
|
+
"@afterpack/core": "~1.0.0",
|
|
32
|
+
"@afterpack/integration-utils": "1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@biomejs/biome": "2.4.4",
|
|
36
36
|
"@types/node": "^22.0.0",
|
|
37
|
-
"esbuild": ">=0.
|
|
37
|
+
"esbuild": ">=0.25.0",
|
|
38
38
|
"tsdown": "^0.11.0",
|
|
39
39
|
"typescript": "^5.0.0",
|
|
40
|
-
"vitest": "^
|
|
40
|
+
"vitest": "^4.1.12"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=18"
|