single-file-core 1.5.89 → 1.5.91

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.
@@ -0,0 +1,54 @@
1
+ /* global URL */
2
+
3
+ import { readFileSync } from "node:fs";
4
+ import terser from "@rollup/plugin-terser";
5
+
6
+ const reservedPropertyNames = [...JSON.parse(readFileSync(new URL("./reserved-property-names.json", import.meta.url))), "inflateRaw"];
7
+
8
+ const bundledTerserOptions = {
9
+ compress: {
10
+ unsafe: true,
11
+ unsafe_arrows: true,
12
+ unsafe_comps: true,
13
+ unsafe_symbols: true,
14
+ unsafe_proto: true,
15
+ keep_fargs: false,
16
+ passes: 3,
17
+ ecma: 2019
18
+ },
19
+ mangle: {
20
+ properties: {
21
+ keep_quoted: "strict",
22
+ reserved: reservedPropertyNames
23
+ }
24
+ }
25
+ };
26
+
27
+ const GLOBALS = "const { Array, Object, String, Number, BigInt, Math, Date, Map, Set, Response, URL, Error, Uint8Array, Uint16Array, Uint32Array, DataView, Blob, Promise, TextEncoder, TextDecoder, crypto, btoa, TransformStream, ReadableStream, WritableStream, CompressionStream, DecompressionStream, navigator, Worker, setTimeout, clearTimeout } = typeof globalThis !== 'undefined' ? globalThis : this || self;";
28
+ const GLOBALS_WORKER = "const { Array, Object, Number, Math, Error, Uint8Array, Uint16Array, Uint32Array, Int32Array, Map, DataView, Promise, TextEncoder, crypto, postMessage, TransformStream, ReadableStream, WritableStream, CompressionStream, DecompressionStream } = self;";
29
+
30
+ export default [{
31
+ input: "lib/zip.js",
32
+ output: [{
33
+ intro: GLOBALS,
34
+ file: "../vendor/zip/zip.min.js",
35
+ format: "umd",
36
+ name: "zip",
37
+ plugins: [terser(bundledTerserOptions)]
38
+ }]
39
+ }, {
40
+ input: "lib/zip-vendor.js",
41
+ output: [{
42
+ intro: GLOBALS,
43
+ file: "../vendor/zip/zip.js",
44
+ format: "es"
45
+ }]
46
+ }, {
47
+ input: "lib/zip-vendor-worker.js",
48
+ output: [{
49
+ intro: GLOBALS_WORKER,
50
+ file: "../vendor/zip/z-worker.js",
51
+ format: "iife",
52
+ plugins: [terser(bundledTerserOptions)]
53
+ }]
54
+ }];