@afterpack/parcel-optimizer 0.1.0 → 0.2.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 +11 -8
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -64,16 +64,17 @@ unknown or misspelled key fails the build and names the right spelling.
|
|
|
64
64
|
[paths.include]: https://www.afterpack.dev/docs/config#paths-include
|
|
65
65
|
|
|
66
66
|
The plugin writes one [Protection Map](https://www.afterpack.dev/docs/protection-map) per bundle to
|
|
67
|
-
`.afterpack
|
|
68
|
-
or commit it.
|
|
67
|
+
`.afterpack/`, which carries its own `.gitignore` and self-ignores. It contains your original
|
|
68
|
+
source, so never deploy or commit it.
|
|
69
69
|
|
|
70
70
|
## Things to know
|
|
71
71
|
|
|
72
72
|
- **Seeds.** Parcel builds bundles in several worker processes. Set [`seed`][seed] (or `AFTERPACK_SEED`) to
|
|
73
73
|
use one seed across the whole build.
|
|
74
|
-
- **Directives.** `/* @afterpack */`
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
- **Directives.** `/* @afterpack */` [directives](https://www.afterpack.dev/docs/directives) that
|
|
75
|
+
raise protection for a region are a [Pro](https://www.afterpack.dev/docs/pro) feature. They are
|
|
76
|
+
read back from the bundle's source map, so enable source maps on the target. Directives in your
|
|
77
|
+
entry module usually cannot be recovered; move that code into an imported module.
|
|
77
78
|
- **Content hashes.** When Parcel targets browsers without native ES modules, it can put
|
|
78
79
|
content-hash placeholders in string literals, and obfuscation would break the lazy-chunk URLs. The
|
|
79
80
|
plugin detects this and fails the build. Build with `parcel build --no-content-hash`, or use
|
|
@@ -87,10 +88,12 @@ or commit it.
|
|
|
87
88
|
|
|
88
89
|
## Pro
|
|
89
90
|
|
|
90
|
-
Without a key, AfterPack runs on your machine
|
|
91
|
+
Without a key, AfterPack runs on your machine with the full pipeline at any preset. Set
|
|
91
92
|
[`AFTERPACK_KEY`](https://www.afterpack.dev/docs/config#key) in your environment and the same
|
|
92
|
-
optimizer
|
|
93
|
-
[
|
|
93
|
+
optimizer builds in AfterPack's cloud instead, which adds per-region
|
|
94
|
+
[directives](https://www.afterpack.dev/docs/directives) and two hardening transforms you can turn
|
|
95
|
+
on: self-integrity (anti-tamper) and comparison hardening. See [AfterPack
|
|
96
|
+
Pro](https://www.afterpack.dev/docs/pro).
|
|
94
97
|
|
|
95
98
|
## Links
|
|
96
99
|
|
package/dist/index.js
CHANGED
|
@@ -92,7 +92,7 @@ var src_default = new Optimizer({
|
|
|
92
92
|
client: resolveClientIdentity(import.meta.url),
|
|
93
93
|
telemetry: createTelemetryReporter(),
|
|
94
94
|
label: "afterpack-parcel",
|
|
95
|
-
|
|
95
|
+
cwd: options.projectRoot,
|
|
96
96
|
startedAt,
|
|
97
97
|
combinedProtectionMap: {
|
|
98
98
|
buildDir: bundle.target.distDir,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afterpack/parcel-optimizer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Parcel 2 optimizer for AfterPack: obfuscate each JavaScript bundle in memory during parcel build",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"@parcel/core": ">=2.9.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@afterpack/core": "~0.
|
|
24
|
+
"@afterpack/core": "~0.2.0",
|
|
25
25
|
"@parcel/diagnostic": "^2.9.0",
|
|
26
26
|
"@parcel/plugin": "^2.9.0",
|
|
27
27
|
"@parcel/source-map": "^2.1.1",
|
|
28
|
-
"@afterpack/integration-utils": "0.
|
|
28
|
+
"@afterpack/integration-utils": "0.2.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@biomejs/biome": "2.4.4",
|