@afterpack/rollup 0.2.0 → 0.2.1

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 CHANGED
@@ -42,7 +42,7 @@ afterpackRollup({ preset: "hard", seed: "git" });
42
42
  | [`seed`][seed] | a number or string; `"git"` uses the current commit | a new random seed per build |
43
43
  | [`identifiers.reserved`][identifiers.reserved] | names never to rename | none |
44
44
  | [`paths.exclude`][paths.exclude] | globs for files to leave untouched | none |
45
- | [`sourceMap.enabled`][sourceMap.enabled] | write source maps for the obfuscated output | on in development when Rollup emits a map, off in production |
45
+ | [`sourceMap.enabled`][sourceMap.enabled] | write source maps for the obfuscated output; off also drops the build's CSS maps | on in development when Rollup emits a map, off in production |
46
46
  | [`protectionMap.enabled`][protectionMap.enabled] | write the Protection Map | on when `output.sourcemap` is set |
47
47
  | [`build.autorun`][build.autorun] | `false` turns AfterPack off | `true` |
48
48
 
package/dist/index.cjs CHANGED
@@ -118,6 +118,7 @@ function afterpackRollup(options = {}) {
118
118
  const entry = entries.get(out.path);
119
119
  if (entry) (0, __afterpack_integration_utils.applyBundleOutput)(bundle, entry, out, result.policy);
120
120
  }
121
+ if (!result.policy.sourceMap) (0, __afterpack_integration_utils.stripBundleCssSourceMaps)(bundle);
121
122
  if (result.deferredReceipt) deferredReceiptByOutDir.set(outDir, result.deferredReceipt);
122
123
  }
123
124
  },
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { dirname, join } from "node:path";
2
2
  import { processBatch, version } from "@afterpack/core";
3
- import { applyBundleOutput, collectBundleJs, createTelemetryReporter, passSettings, resolveClientIdentity, resolvePluginConfig, runObfuscationPass, scanDirectives, writeDeferredProtectionReceipt } from "@afterpack/integration-utils";
3
+ import { applyBundleOutput, collectBundleJs, createTelemetryReporter, passSettings, resolveClientIdentity, resolvePluginConfig, runObfuscationPass, scanDirectives, stripBundleCssSourceMaps, writeDeferredProtectionReceipt } from "@afterpack/integration-utils";
4
4
 
5
5
  //#region src/index.ts
6
6
  const PATHS_INCLUDE_UNSUPPORTED = "this plugin obfuscates Rollup's own bundle, in the pipeline — there is no output-directory walk for a glob to re-admit anything into. Use `npx afterpack <dir> --paths.include=...` for a disk walk, or drop the key.";
@@ -95,6 +95,7 @@ function afterpackRollup(options = {}) {
95
95
  const entry = entries.get(out.path);
96
96
  if (entry) applyBundleOutput(bundle, entry, out, result.policy);
97
97
  }
98
+ if (!result.policy.sourceMap) stripBundleCssSourceMaps(bundle);
98
99
  if (result.deferredReceipt) deferredReceiptByOutDir.set(outDir, result.deferredReceipt);
99
100
  }
100
101
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afterpack/rollup",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Rollup plugin for AfterPack: obfuscate your JavaScript output during the Rollup build",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -28,8 +28,8 @@
28
28
  "rollup": "^3.0.0 || ^4.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "@afterpack/core": "~0.2.0",
32
- "@afterpack/integration-utils": "0.2.0"
31
+ "@afterpack/core": "~0.2.2",
32
+ "@afterpack/integration-utils": "0.2.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@biomejs/biome": "2.4.4",