unplugin-strip-whitespace 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SegaraRai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # unplugin-strip-whitespace
2
+
3
+ Strip inter-node whitespace in `.astro` and `.svelte` templates _before_ they’re compiled.
4
+
5
+ This package is an [unplugin](https://github.com/unjs/unplugin) plugin, so it works with Vite, Rollup, Webpack, Rspack, esbuild, Farm, Nuxt, and more.
6
+
7
+ If you’re using Astro, you may prefer the dedicated integration: [`astro-strip-whitespace`](../astro-strip-whitespace).
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add -D unplugin-strip-whitespace
13
+ # npm i -D unplugin-strip-whitespace
14
+ # yarn add -D unplugin-strip-whitespace
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ### Vite
20
+
21
+ ```ts
22
+ // vite.config.ts
23
+ import { defineConfig } from "vite";
24
+ import stripWhitespace from "unplugin-strip-whitespace/vite";
25
+
26
+ export default defineConfig({
27
+ plugins: [stripWhitespace()],
28
+ });
29
+ ```
30
+
31
+ ### Rollup
32
+
33
+ ```ts
34
+ // rollup.config.ts
35
+ import stripWhitespace from "unplugin-strip-whitespace/rollup";
36
+
37
+ export default {
38
+ plugins: [stripWhitespace()],
39
+ };
40
+ ```
41
+
42
+ ### Webpack
43
+
44
+ ```ts
45
+ // webpack.config.js
46
+ const stripWhitespace = require("unplugin-strip-whitespace/webpack");
47
+
48
+ module.exports = {
49
+ plugins: [stripWhitespace.default()],
50
+ };
51
+ ```
52
+
53
+ ### Rspack
54
+
55
+ ```ts
56
+ // rspack.config.ts
57
+ import stripWhitespace from "unplugin-strip-whitespace/rspack";
58
+
59
+ export default {
60
+ plugins: [stripWhitespace()],
61
+ };
62
+ ```
63
+
64
+ ### esbuild
65
+
66
+ ```ts
67
+ import stripWhitespace from "unplugin-strip-whitespace/esbuild";
68
+
69
+ // ...
70
+ plugins: [stripWhitespace()],
71
+ ```
72
+
73
+ ### Nuxt
74
+
75
+ This package also ships a small Nuxt module.
76
+
77
+ ```ts
78
+ // nuxt.config.ts
79
+ export default defineNuxtConfig({
80
+ modules: ["unplugin-strip-whitespace/nuxt"],
81
+ unpluginStripWhitespace: {
82
+ preserveBlankLines: true,
83
+ },
84
+ });
85
+ ```
86
+
87
+ ## Options
88
+
89
+ All options are optional.
90
+
91
+ ```ts
92
+ import type { StripWhitespaceOptions } from "unplugin-strip-whitespace";
93
+ ```
94
+
95
+ - `selectLanguage`: `("astro" | "svelte")[]` or `(id, content) => "astro" | "svelte" | false`
96
+ - Default behavior processes `.astro` and `.svelte` files, skipping `node_modules` and any id containing a query string (`?`).
97
+ - `preserveBlankLines`: `boolean` or `(lang, id, content) => boolean`
98
+ - When `true`, skips stripping for gaps that contain an empty line (useful as a “section break” marker).
99
+ - `movePluginBefore`: `RegExp` | `(name) => boolean` | `false` | `{ vite?: …; rollup?: …; ... }`
100
+ - Attempts to move this plugin earlier in the final plugin list (where supported).
101
+ - Default: `/^astro:build|^vite-plugin-svelte$/`.
102
+ - `skipOnError`: `boolean`
103
+ - When `true`, errors are logged as warnings and the transform is skipped.
104
+
105
+ Example:
106
+
107
+ ```ts
108
+ stripWhitespace({
109
+ preserveBlankLines: true,
110
+ movePluginBefore: {
111
+ vite: /^astro:build|^vite-plugin-svelte$/,
112
+ },
113
+ });
114
+ ```
115
+
116
+ ## What it strips (and why)
117
+
118
+ This removes whitespace-only gaps between nodes in templates. It’s designed to be safe for hydration by running _before_ Astro/Svelte compilation, rather than minifying the final HTML output.
119
+
120
+ ## License
121
+
122
+ MIT
@@ -0,0 +1,8 @@
1
+ import { StripWhitespaceOptions } from "./types.mjs";
2
+ import * as esbuild0 from "esbuild";
3
+
4
+ //#region src/esbuild.d.ts
5
+ declare const _default: (options?: StripWhitespaceOptions | undefined) => esbuild0.Plugin;
6
+ //#endregion
7
+ export { _default as default };
8
+ //# sourceMappingURL=esbuild.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.d.mts","names":[],"sources":["../src/esbuild.ts"],"sourcesContent":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { i as unpluginFactory } from "./src-KUYBObHk.mjs";
2
+ import { createEsbuildPlugin } from "unplugin";
3
+
4
+ //#region src/esbuild.ts
5
+ var esbuild_default = createEsbuildPlugin(unpluginFactory);
6
+
7
+ //#endregion
8
+ export { esbuild_default as default };
9
+ //# sourceMappingURL=esbuild.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.mjs","names":[],"sources":["../src/esbuild.ts"],"sourcesContent":["import { createEsbuildPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createEsbuildPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,sBAAe,oBAAoB,gBAAgB"}
@@ -0,0 +1,8 @@
1
+ import { StripWhitespaceOptions } from "./types.mjs";
2
+ import * as _farmfe_core0 from "@farmfe/core";
3
+
4
+ //#region src/farm.d.ts
5
+ declare const _default: (options?: StripWhitespaceOptions | undefined) => _farmfe_core0.JsPlugin;
6
+ //#endregion
7
+ export { _default as default };
8
+ //# sourceMappingURL=farm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"farm.d.mts","names":[],"sources":["../src/farm.ts"],"sourcesContent":[],"mappings":""}
package/dist/farm.mjs ADDED
@@ -0,0 +1,9 @@
1
+ import { i as unpluginFactory } from "./src-KUYBObHk.mjs";
2
+ import { createFarmPlugin } from "unplugin";
3
+
4
+ //#region src/farm.ts
5
+ var farm_default = createFarmPlugin(unpluginFactory);
6
+
7
+ //#endregion
8
+ export { farm_default as default };
9
+ //# sourceMappingURL=farm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"farm.mjs","names":[],"sources":["../src/farm.ts"],"sourcesContent":["import { createFarmPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createFarmPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,mBAAe,iBAAiB,gBAAgB"}
@@ -0,0 +1,11 @@
1
+ import { Language, StripWhitespaceOptions } from "./types.mjs";
2
+ import * as unplugin0 from "unplugin";
3
+ import { UnpluginFactory } from "unplugin";
4
+
5
+ //#region src/index.d.ts
6
+ declare function defaultLanguageSelector(id: string, _content: string): Language | false;
7
+ declare const unpluginFactory: UnpluginFactory<StripWhitespaceOptions | undefined>;
8
+ declare const unplugin: unplugin0.UnpluginInstance<StripWhitespaceOptions | undefined, boolean>;
9
+ //#endregion
10
+ export { type Language, type StripWhitespaceOptions, unplugin as default, unplugin, defaultLanguageSelector, unpluginFactory };
11
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;iBAgBgB,uBAAA,gCAGb;cAmFU,iBAAiB,gBAC5B;AAvFc,cAiRH,QAjRG,EAiRK,SAAA,CAAA,gBA9QV,CA8QU,sBA9QV,GAAA,SAAA,EAAA,OAAA,CAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { i as unpluginFactory, n as src_default, r as unplugin, t as defaultLanguageSelector } from "./src-KUYBObHk.mjs";
2
+
3
+ export { src_default as default, defaultLanguageSelector, unplugin, unpluginFactory };
@@ -0,0 +1,9 @@
1
+ import { StripWhitespaceOptions } from "./types.mjs";
2
+ import * as _nuxt_schema0 from "@nuxt/schema";
3
+
4
+ //#region src/nuxt.d.ts
5
+ interface ModuleOptions extends StripWhitespaceOptions {}
6
+ declare const _default: _nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
7
+ //#endregion
8
+ export { ModuleOptions, _default as default };
9
+ //# sourceMappingURL=nuxt.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt.d.mts","names":[],"sources":["../src/nuxt.ts"],"sourcesContent":[],"mappings":";;;;UAKiB,aAAA,SAAsB;cAAyB"}
package/dist/nuxt.mjs ADDED
@@ -0,0 +1,21 @@
1
+ import "./src-KUYBObHk.mjs";
2
+ import vite_default from "./vite.mjs";
3
+ import webpack_default from "./webpack.mjs";
4
+ import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
5
+
6
+ //#region src/nuxt.ts
7
+ var nuxt_default = defineNuxtModule({
8
+ meta: {
9
+ name: "nuxt-strip-whitespace",
10
+ configKey: "unpluginStripWhitespace"
11
+ },
12
+ defaults: {},
13
+ setup(options, _nuxt) {
14
+ addVitePlugin(() => vite_default(options), { prepend: true });
15
+ addWebpackPlugin(() => webpack_default(options), { prepend: true });
16
+ }
17
+ });
18
+
19
+ //#endregion
20
+ export { nuxt_default as default };
21
+ //# sourceMappingURL=nuxt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuxt.mjs","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from \"@nuxt/kit\";\nimport type { StripWhitespaceOptions } from \"./types\";\nimport vite from \"./vite\";\nimport webpack from \"./webpack\";\n\nexport interface ModuleOptions extends StripWhitespaceOptions {}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: \"nuxt-strip-whitespace\",\n configKey: \"unpluginStripWhitespace\",\n },\n defaults: {\n // ...default options\n },\n setup(options, _nuxt) {\n addVitePlugin(() => vite(options), { prepend: true });\n addWebpackPlugin(() => webpack(options), { prepend: true });\n },\n});\n"],"mappings":";;;;;;AAOA,mBAAe,iBAAgC;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;EACZ;CACD,UAAU,EAET;CACD,MAAM,SAAS,OAAO;AACpB,sBAAoBA,aAAK,QAAQ,EAAE,EAAE,SAAS,MAAM,CAAC;AACrD,yBAAuBC,gBAAQ,QAAQ,EAAE,EAAE,SAAS,MAAM,CAAC;;CAE9D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { StripWhitespaceOptions } from "./types.mjs";
2
+ import * as rollup0 from "rollup";
3
+
4
+ //#region src/rollup.d.ts
5
+ declare const _default: (options?: StripWhitespaceOptions | undefined) => rollup0.Plugin<any> | rollup0.Plugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
8
+ //# sourceMappingURL=rollup.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.d.mts","names":[],"sources":["../src/rollup.ts"],"sourcesContent":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { i as unpluginFactory } from "./src-KUYBObHk.mjs";
2
+ import { createRollupPlugin } from "unplugin";
3
+
4
+ //#region src/rollup.ts
5
+ var rollup_default = createRollupPlugin(unpluginFactory);
6
+
7
+ //#endregion
8
+ export { rollup_default as default };
9
+ //# sourceMappingURL=rollup.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.mjs","names":[],"sources":["../src/rollup.ts"],"sourcesContent":["import { createRollupPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createRollupPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,qBAAe,mBAAmB,gBAAgB"}
@@ -0,0 +1,8 @@
1
+ import { StripWhitespaceOptions } from "./types.mjs";
2
+ import * as unplugin2 from "unplugin";
3
+
4
+ //#region src/rspack.d.ts
5
+ declare const _default: (options?: StripWhitespaceOptions | undefined) => unplugin2.RspackPluginInstance;
6
+ //#endregion
7
+ export { _default as default };
8
+ //# sourceMappingURL=rspack.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack.d.mts","names":[],"sources":["../src/rspack.ts"],"sourcesContent":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { i as unpluginFactory } from "./src-KUYBObHk.mjs";
2
+ import { createRspackPlugin } from "unplugin";
3
+
4
+ //#region src/rspack.ts
5
+ var rspack_default = createRspackPlugin(unpluginFactory);
6
+
7
+ //#endregion
8
+ export { rspack_default as default };
9
+ //# sourceMappingURL=rspack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack.mjs","names":[],"sources":["../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createRspackPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,qBAAe,mBAAmB,gBAAgB"}
@@ -0,0 +1,459 @@
1
+ import { createUnplugin } from "unplugin";
2
+ import { readFileSync } from "node:fs";
3
+
4
+ //#region ../wasm/dist/index.js
5
+ let wasm;
6
+ function debugString(val) {
7
+ const type = typeof val;
8
+ if (type == "number" || type == "boolean" || val == null) return `${val}`;
9
+ if (type == "string") return `"${val}"`;
10
+ if (type == "symbol") {
11
+ const description = val.description;
12
+ if (description == null) return "Symbol";
13
+ else return `Symbol(${description})`;
14
+ }
15
+ if (type == "function") {
16
+ const name = val.name;
17
+ if (typeof name == "string" && name.length > 0) return `Function(${name})`;
18
+ else return "Function";
19
+ }
20
+ if (Array.isArray(val)) {
21
+ const length = val.length;
22
+ let debug = "[";
23
+ if (length > 0) debug += debugString(val[0]);
24
+ for (let i = 1; i < length; i++) debug += ", " + debugString(val[i]);
25
+ debug += "]";
26
+ return debug;
27
+ }
28
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
29
+ let className;
30
+ if (builtInMatches && builtInMatches.length > 1) className = builtInMatches[1];
31
+ else return toString.call(val);
32
+ if (className == "Object") try {
33
+ return "Object(" + JSON.stringify(val) + ")";
34
+ } catch (_) {
35
+ return "Object";
36
+ }
37
+ if (val instanceof Error) return `${val.name}: ${val.message}\n${val.stack}`;
38
+ return className;
39
+ }
40
+ function getArrayU8FromWasm0(ptr, len) {
41
+ ptr = ptr >>> 0;
42
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
43
+ }
44
+ let cachedDataViewMemory0 = null;
45
+ function getDataViewMemory0() {
46
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
47
+ return cachedDataViewMemory0;
48
+ }
49
+ function getStringFromWasm0(ptr, len) {
50
+ ptr = ptr >>> 0;
51
+ return decodeText(ptr, len);
52
+ }
53
+ let cachedUint8ArrayMemory0 = null;
54
+ function getUint8ArrayMemory0() {
55
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
56
+ return cachedUint8ArrayMemory0;
57
+ }
58
+ function isLikeNone(x) {
59
+ return x === void 0 || x === null;
60
+ }
61
+ function passStringToWasm0(arg, malloc, realloc) {
62
+ if (realloc === void 0) {
63
+ const buf = cachedTextEncoder.encode(arg);
64
+ const ptr$1 = malloc(buf.length, 1) >>> 0;
65
+ getUint8ArrayMemory0().subarray(ptr$1, ptr$1 + buf.length).set(buf);
66
+ WASM_VECTOR_LEN = buf.length;
67
+ return ptr$1;
68
+ }
69
+ let len = arg.length;
70
+ let ptr = malloc(len, 1) >>> 0;
71
+ const mem = getUint8ArrayMemory0();
72
+ let offset = 0;
73
+ for (; offset < len; offset++) {
74
+ const code = arg.charCodeAt(offset);
75
+ if (code > 127) break;
76
+ mem[ptr + offset] = code;
77
+ }
78
+ if (offset !== len) {
79
+ if (offset !== 0) arg = arg.slice(offset);
80
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
81
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
82
+ const ret = cachedTextEncoder.encodeInto(arg, view);
83
+ offset += ret.written;
84
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
85
+ }
86
+ WASM_VECTOR_LEN = offset;
87
+ return ptr;
88
+ }
89
+ function takeFromExternrefTable0(idx) {
90
+ const value = wasm.__wbindgen_externrefs.get(idx);
91
+ wasm.__externref_table_dealloc(idx);
92
+ return value;
93
+ }
94
+ let cachedTextDecoder = new TextDecoder("utf-8", {
95
+ ignoreBOM: true,
96
+ fatal: true
97
+ });
98
+ cachedTextDecoder.decode();
99
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
100
+ let numBytesDecoded = 0;
101
+ function decodeText(ptr, len) {
102
+ numBytesDecoded += len;
103
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
104
+ cachedTextDecoder = new TextDecoder("utf-8", {
105
+ ignoreBOM: true,
106
+ fatal: true
107
+ });
108
+ cachedTextDecoder.decode();
109
+ numBytesDecoded = len;
110
+ }
111
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
112
+ }
113
+ const cachedTextEncoder = new TextEncoder();
114
+ if (!("encodeInto" in cachedTextEncoder)) cachedTextEncoder.encodeInto = function(arg, view) {
115
+ const buf = cachedTextEncoder.encode(arg);
116
+ view.set(buf);
117
+ return {
118
+ read: arg.length,
119
+ written: buf.length
120
+ };
121
+ };
122
+ let WASM_VECTOR_LEN = 0;
123
+ /**
124
+ * Strip inter-node whitespace and create a brand-new sourcemap.
125
+ *
126
+ * `source_name` is recorded as the sourcemap's source filename.
127
+ * `language` specifies the template language (e.g., "astro" or "svelte").
128
+ * @param {string} code
129
+ * @param {string} source_name
130
+ * @param {Language} language
131
+ * @param {StripConfig} config
132
+ * @returns {StripOutput}
133
+ */
134
+ function stripWhitespace(code, source_name, language, config) {
135
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
136
+ const len0 = WASM_VECTOR_LEN;
137
+ const ptr1 = passStringToWasm0(source_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
138
+ const len1 = WASM_VECTOR_LEN;
139
+ const ret = wasm.stripWhitespace(ptr0, len0, ptr1, len1, language, config);
140
+ if (ret[2]) throw takeFromExternrefTable0(ret[1]);
141
+ return takeFromExternrefTable0(ret[0]);
142
+ }
143
+ const EXPECTED_RESPONSE_TYPES = new Set([
144
+ "basic",
145
+ "cors",
146
+ "default"
147
+ ]);
148
+ async function __wbg_load(module, imports) {
149
+ if (typeof Response === "function" && module instanceof Response) {
150
+ if (typeof WebAssembly.instantiateStreaming === "function") try {
151
+ return await WebAssembly.instantiateStreaming(module, imports);
152
+ } catch (e) {
153
+ if (module.ok && EXPECTED_RESPONSE_TYPES.has(module.type) && module.headers.get("Content-Type") !== "application/wasm") console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
154
+ else throw e;
155
+ }
156
+ const bytes = await module.arrayBuffer();
157
+ return await WebAssembly.instantiate(bytes, imports);
158
+ } else {
159
+ const instance = await WebAssembly.instantiate(module, imports);
160
+ if (instance instanceof WebAssembly.Instance) return {
161
+ instance,
162
+ module
163
+ };
164
+ else return instance;
165
+ }
166
+ }
167
+ function __wbg_get_imports() {
168
+ const imports = {};
169
+ imports.wbg = {};
170
+ imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
171
+ return Error(getStringFromWasm0(arg0, arg1));
172
+ };
173
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
174
+ const ptr1 = passStringToWasm0(String(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
175
+ const len1 = WASM_VECTOR_LEN;
176
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
177
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
178
+ };
179
+ imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
180
+ const v = arg0;
181
+ const ret = typeof v === "boolean" ? v : void 0;
182
+ return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
183
+ };
184
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
185
+ const ptr1 = passStringToWasm0(debugString(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
186
+ const len1 = WASM_VECTOR_LEN;
187
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
188
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
189
+ };
190
+ imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
191
+ return arg0 in arg1;
192
+ };
193
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
194
+ const val = arg0;
195
+ return typeof val === "object" && val !== null;
196
+ };
197
+ imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
198
+ return typeof arg0 === "string";
199
+ };
200
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
201
+ return arg0 === void 0;
202
+ };
203
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
204
+ return arg0 == arg1;
205
+ };
206
+ imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
207
+ const obj = arg1;
208
+ const ret = typeof obj === "number" ? obj : void 0;
209
+ getDataViewMemory0().setFloat64(arg0 + 8, isLikeNone(ret) ? 0 : ret, true);
210
+ getDataViewMemory0().setInt32(arg0 + 0, !isLikeNone(ret), true);
211
+ };
212
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
213
+ const obj = arg1;
214
+ const ret = typeof obj === "string" ? obj : void 0;
215
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
216
+ var len1 = WASM_VECTOR_LEN;
217
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
218
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
219
+ };
220
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
221
+ throw new Error(getStringFromWasm0(arg0, arg1));
222
+ };
223
+ imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
224
+ return Object.entries(arg0);
225
+ };
226
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
227
+ let deferred0_0;
228
+ let deferred0_1;
229
+ try {
230
+ deferred0_0 = arg0;
231
+ deferred0_1 = arg1;
232
+ console.error(getStringFromWasm0(arg0, arg1));
233
+ } finally {
234
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
235
+ }
236
+ };
237
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
238
+ return arg0[arg1 >>> 0];
239
+ };
240
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
241
+ return arg0[arg1];
242
+ };
243
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
244
+ let result;
245
+ try {
246
+ result = arg0 instanceof ArrayBuffer;
247
+ } catch (_) {
248
+ result = false;
249
+ }
250
+ return result;
251
+ };
252
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
253
+ let result;
254
+ try {
255
+ result = arg0 instanceof Uint8Array;
256
+ } catch (_) {
257
+ result = false;
258
+ }
259
+ return result;
260
+ };
261
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
262
+ return arg0.length;
263
+ };
264
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
265
+ return arg0.length;
266
+ };
267
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
268
+ return /* @__PURE__ */ new Object();
269
+ };
270
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
271
+ return new Uint8Array(arg0);
272
+ };
273
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
274
+ return /* @__PURE__ */ new Error();
275
+ };
276
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
277
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
278
+ };
279
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
280
+ arg0[arg1] = arg2;
281
+ };
282
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
283
+ const ret = arg1.stack;
284
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
285
+ const len1 = WASM_VECTOR_LEN;
286
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
287
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
288
+ };
289
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
290
+ return getStringFromWasm0(arg0, arg1);
291
+ };
292
+ imports.wbg.__wbindgen_init_externref_table = function() {
293
+ const table = wasm.__wbindgen_externrefs;
294
+ const offset = table.grow(4);
295
+ table.set(0, void 0);
296
+ table.set(offset + 0, void 0);
297
+ table.set(offset + 1, null);
298
+ table.set(offset + 2, true);
299
+ table.set(offset + 3, false);
300
+ };
301
+ return imports;
302
+ }
303
+ function __wbg_finalize_init(instance, module) {
304
+ wasm = instance.exports;
305
+ __wbg_init.__wbindgen_wasm_module = module;
306
+ cachedDataViewMemory0 = null;
307
+ cachedUint8ArrayMemory0 = null;
308
+ wasm.__wbindgen_start();
309
+ return wasm;
310
+ }
311
+ function initSync(module) {
312
+ if (wasm !== void 0) return wasm;
313
+ if (typeof module !== "undefined") if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
314
+ else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
315
+ const imports = __wbg_get_imports();
316
+ if (!(module instanceof WebAssembly.Module)) module = new WebAssembly.Module(module);
317
+ return __wbg_finalize_init(new WebAssembly.Instance(module, imports), module);
318
+ }
319
+ async function __wbg_init(module_or_path) {
320
+ if (wasm !== void 0) return wasm;
321
+ if (typeof module_or_path !== "undefined") if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
322
+ else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
323
+ if (typeof module_or_path === "undefined") module_or_path = new URL("index_bg.wasm", import.meta.url);
324
+ const imports = __wbg_get_imports();
325
+ if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
326
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
327
+ return __wbg_finalize_init(instance, module);
328
+ }
329
+
330
+ //#endregion
331
+ //#region ../wasm/dist/index_bg.wasm
332
+ var index_bg_default = "assets/index_bg-CansJpoR.wasm";
333
+
334
+ //#endregion
335
+ //#region src/internal/wasm.ts
336
+ let initOutput;
337
+ function initWasmOnce() {
338
+ if (!initOutput) initOutput = initSync({ module: readFileSync(new URL(index_bg_default, import.meta.url)) });
339
+ return initOutput;
340
+ }
341
+
342
+ //#endregion
343
+ //#region src/internal/consts.ts
344
+ const UNPLUGIN_NAME = "unplugin-strip-whitespace";
345
+
346
+ //#endregion
347
+ //#region src/index.ts
348
+ function defaultLanguageSelector(id, _content) {
349
+ if (id.includes("?") || id.includes("node_modules/") || id.includes("node_modules\\")) return false;
350
+ if (id.endsWith(".astro")) return "astro";
351
+ if (id.endsWith(".svelte")) return "svelte";
352
+ return false;
353
+ }
354
+ function createLanguageSelectorFromArray(languages) {
355
+ return (id, content) => {
356
+ const lang = defaultLanguageSelector(id, content);
357
+ if (lang && languages.includes(lang)) return lang;
358
+ return false;
359
+ };
360
+ }
361
+ function resolvePluginMatcher(matcher, bundler) {
362
+ if (typeof matcher === "object" && !(matcher instanceof RegExp)) return matcher[bundler] ?? false;
363
+ return matcher;
364
+ }
365
+ function testPluginName(matcher, name) {
366
+ if (matcher instanceof RegExp) return matcher.test(name);
367
+ return matcher(name);
368
+ }
369
+ function toArray(name) {
370
+ if (name == null) return [];
371
+ return Array.isArray(name) ? name : [name];
372
+ }
373
+ function reorder(array, getName, itemNameToMove, matcher) {
374
+ const itemIndex = array.findIndex((item$1) => toArray(getName(item$1)).includes(itemNameToMove));
375
+ if (itemIndex === -1) return;
376
+ const matchIndex = array.map((item$1) => toArray(getName(item$1))).findIndex((names) => names.some((name) => testPluginName(matcher, name)));
377
+ if (matchIndex === -1) return;
378
+ if (itemIndex < matchIndex) return;
379
+ const [item] = array.splice(itemIndex, 1);
380
+ array.splice(matchIndex, 0, item);
381
+ }
382
+ const unpluginFactory = (options) => {
383
+ initWasmOnce();
384
+ const { selectLanguage: rawSelectLanguage = defaultLanguageSelector, preserveBlankLines: rawPreserveBlankLines = false, movePluginBefore: rawMovePluginBefore = /^astro:build|^vite-plugin-svelte$/, skipOnError = false } = options ?? {};
385
+ const selectLanguage = Array.isArray(rawSelectLanguage) ? createLanguageSelectorFromArray(rawSelectLanguage) : rawSelectLanguage;
386
+ return {
387
+ name: UNPLUGIN_NAME,
388
+ enforce: "pre",
389
+ transform: {
390
+ filter: selectLanguage === defaultLanguageSelector ? { id: {
391
+ include: [/\.astro$/, /\.svelte$/],
392
+ exclude: [/\?/]
393
+ } } : void 0,
394
+ async handler(code, id) {
395
+ const language = selectLanguage(id, code);
396
+ if (!language) return null;
397
+ const preserveBlankLines = typeof rawPreserveBlankLines === "function" ? rawPreserveBlankLines(language, id, code) : rawPreserveBlankLines;
398
+ try {
399
+ const result = stripWhitespace(code, id, language, { preserveBlankLines });
400
+ if (result.code === code) return null;
401
+ return result;
402
+ } catch (err) {
403
+ if (skipOnError) {
404
+ this.warn(`failed to process ${id}, skipping. Error: ${err}`);
405
+ return null;
406
+ }
407
+ this.error(`failed to process ${id}. Error: ${err}`);
408
+ throw err;
409
+ }
410
+ }
411
+ },
412
+ esbuild: { config(options$1) {
413
+ const matcher = resolvePluginMatcher(rawMovePluginBefore, "esbuild");
414
+ if (!matcher || !options$1.plugins) return;
415
+ reorder(options$1.plugins, (plugin) => plugin.name, UNPLUGIN_NAME, matcher);
416
+ } },
417
+ farm: { configResolved(config) {
418
+ const matcher = resolvePluginMatcher(rawMovePluginBefore, "farm");
419
+ if (!matcher || !config.jsPlugins) return;
420
+ reorder(config.jsPlugins, (plugin) => plugin.name, UNPLUGIN_NAME, matcher);
421
+ } },
422
+ unloader: { options(config) {
423
+ const matcher = resolvePluginMatcher(rawMovePluginBefore, "unloader");
424
+ if (!matcher || !config.plugins) return;
425
+ reorder(config.plugins, (plugin) => plugin.name, UNPLUGIN_NAME, matcher);
426
+ } },
427
+ rolldown: { options(config) {
428
+ const matcher = resolvePluginMatcher(rawMovePluginBefore, "rolldown");
429
+ if (!matcher || !config.plugins || !Array.isArray(config.plugins)) return;
430
+ const flatten = (plugin) => {
431
+ if (!plugin || plugin instanceof Promise || "_parallel" in plugin) return [];
432
+ if (Array.isArray(plugin)) return plugin.flatMap(flatten);
433
+ return [plugin];
434
+ };
435
+ reorder(config.plugins, (plugin) => flatten(plugin).map((p) => p.name), UNPLUGIN_NAME, matcher);
436
+ } },
437
+ rollup: { options(config) {
438
+ const matcher = resolvePluginMatcher(rawMovePluginBefore, "rollup");
439
+ if (!matcher || !config.plugins || !Array.isArray(config.plugins)) return;
440
+ const flatten = (plugin) => {
441
+ if (!plugin || plugin instanceof Promise) return [];
442
+ if (Array.isArray(plugin)) return plugin.flatMap(flatten);
443
+ return [plugin];
444
+ };
445
+ reorder(config.plugins, (plugin) => flatten(plugin).map((p) => p.name), UNPLUGIN_NAME, matcher);
446
+ } },
447
+ vite: { configResolved(config) {
448
+ const matcher = resolvePluginMatcher(rawMovePluginBefore, "vite");
449
+ if (!matcher) return;
450
+ reorder(config.plugins, (plugin) => plugin.name, UNPLUGIN_NAME, matcher);
451
+ } }
452
+ };
453
+ };
454
+ const unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
455
+ var src_default = unplugin;
456
+
457
+ //#endregion
458
+ export { unpluginFactory as i, src_default as n, unplugin as r, defaultLanguageSelector as t };
459
+ //# sourceMappingURL=src-KUYBObHk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-KUYBObHk.mjs","names":["ptr","wasmPath","item","options"],"sources":["../../wasm/dist/index.js","../../wasm/dist/index_bg.wasm","../src/internal/wasm.ts","../src/internal/consts.ts","../src/index.ts"],"sourcesContent":["let wasm;\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches && builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nlet cachedDataViewMemory0 = null;\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nlet cachedUint8ArrayMemory0 = null;\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\ncachedTextDecoder.decode();\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nconst cachedTextEncoder = new TextEncoder();\n\nif (!('encodeInto' in cachedTextEncoder)) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n }\n}\n\nlet WASM_VECTOR_LEN = 0;\n\n/**\n * Strip inter-node whitespace and create a brand-new sourcemap.\n *\n * `source_name` is recorded as the sourcemap's source filename.\n * `language` specifies the template language (e.g., \"astro\" or \"svelte\").\n * @param {string} code\n * @param {string} source_name\n * @param {Language} language\n * @param {StripConfig} config\n * @returns {StripOutput}\n */\nexport function stripWhitespace(code, source_name, language, config) {\n const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(source_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n const ret = wasm.stripWhitespace(ptr0, len0, ptr1, len1, language, config);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return takeFromExternrefTable0(ret[0]);\n}\n\n/**\n * Strip inter-node whitespace without producing a sourcemap.\n *\n * `language` specifies the template language (e.g., \"astro\" or \"svelte\").\n * @param {string} code\n * @param {Language} language\n * @param {StripConfig} config\n * @returns {string}\n */\nexport function stripWhitespaceNoSourcemap(code, language, config) {\n let deferred3_0;\n let deferred3_1;\n try {\n const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.stripWhitespaceNoSourcemap(ptr0, len0, language, config);\n var ptr2 = ret[0];\n var len2 = ret[1];\n if (ret[3]) {\n ptr2 = 0; len2 = 0;\n throw takeFromExternrefTable0(ret[2]);\n }\n deferred3_0 = ptr2;\n deferred3_1 = len2;\n return getStringFromWasm0(ptr2, len2);\n } finally {\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\nconst EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {\n const ret = Error(getStringFromWasm0(arg0, arg1));\n return ret;\n };\n imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {\n const ret = String(arg1);\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {\n const v = arg0;\n const ret = typeof(v) === 'boolean' ? v : undefined;\n return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;\n };\n imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {\n const ret = debugString(arg1);\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {\n const ret = arg0 in arg1;\n return ret;\n };\n imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {\n const val = arg0;\n const ret = typeof(val) === 'object' && val !== null;\n return ret;\n };\n imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {\n const ret = typeof(arg0) === 'string';\n return ret;\n };\n imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {\n const ret = arg0 === undefined;\n return ret;\n };\n imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {\n const ret = arg0 == arg1;\n return ret;\n };\n imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {\n const obj = arg1;\n const ret = typeof(obj) === 'number' ? obj : undefined;\n getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);\n };\n imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {\n const obj = arg1;\n const ret = typeof(obj) === 'string' ? obj : undefined;\n var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n };\n imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {\n const ret = Object.entries(arg0);\n return ret;\n };\n imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {\n let deferred0_0;\n let deferred0_1;\n try {\n deferred0_0 = arg0;\n deferred0_1 = arg1;\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);\n }\n };\n imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {\n const ret = arg0[arg1 >>> 0];\n return ret;\n };\n imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {\n const ret = arg0[arg1];\n return ret;\n };\n imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {\n let result;\n try {\n result = arg0 instanceof ArrayBuffer;\n } catch (_) {\n result = false;\n }\n const ret = result;\n return ret;\n };\n imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {\n let result;\n try {\n result = arg0 instanceof Uint8Array;\n } catch (_) {\n result = false;\n }\n const ret = result;\n return ret;\n };\n imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {\n const ret = arg0.length;\n return ret;\n };\n imports.wbg.__wbg_new_1ba21ce319a06297 = function() {\n const ret = new Object();\n return ret;\n };\n imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {\n const ret = new Uint8Array(arg0);\n return ret;\n };\n imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {\n const ret = new Error();\n return ret;\n };\n imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {\n Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);\n };\n imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {\n arg0[arg1] = arg2;\n };\n imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {\n const ret = arg1.stack;\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n };\n imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n };\n imports.wbg.__wbindgen_init_externref_table = function() {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n };\n\n return imports;\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n wasm.__wbindgen_start();\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n const instance = new WebAssembly.Instance(module, imports);\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('index_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","__ROLLDOWN_ASSET_FILENAME__","import { initSync, type InitOutput } from \"strip-whitespace-wasm\";\nimport wasmPath from \"strip-whitespace-wasm/wasm\";\nimport { readFileSync } from \"node:fs\";\n\nexport * from \"strip-whitespace-wasm\";\n\nlet initOutput: InitOutput | undefined;\n\nexport function initWasmOnce(): InitOutput {\n if (!initOutput) {\n const wasm = readFileSync(new URL(wasmPath, import.meta.url));\n initOutput = initSync({ module: wasm });\n }\n return initOutput;\n}\n","export const UNPLUGIN_NAME = \"unplugin-strip-whitespace\";\n","import { initWasmOnce, stripWhitespace } from \"#wasm\";\nimport {\n createUnplugin,\n type UnpluginFactory,\n type UnpluginOptions,\n} from \"unplugin\";\nimport { UNPLUGIN_NAME } from \"./internal/consts\";\nimport type {\n Language,\n PluginNameMatcher,\n ReorderableBundlerKind,\n StripWhitespaceOptions,\n} from \"./types\";\n\nexport type { Language, StripWhitespaceOptions } from \"./types\";\n\nexport function defaultLanguageSelector(\n id: string,\n _content: string,\n): Language | false {\n if (\n id.includes(\"?\") ||\n id.includes(\"node_modules/\") ||\n id.includes(\"node_modules\\\\\")\n ) {\n return false;\n }\n\n if (id.endsWith(\".astro\")) {\n return \"astro\";\n }\n\n if (id.endsWith(\".svelte\")) {\n return \"svelte\";\n }\n\n return false;\n}\n\nfunction createLanguageSelectorFromArray(languages: readonly Language[]) {\n return (id: string, content: string): Language | false => {\n const lang = defaultLanguageSelector(id, content);\n if (lang && languages.includes(lang)) {\n return lang;\n }\n return false;\n };\n}\n\nfunction resolvePluginMatcher(\n matcher: NonNullable<StripWhitespaceOptions[\"movePluginBefore\"]>,\n bundler: ReorderableBundlerKind,\n): PluginNameMatcher | false {\n if (typeof matcher === \"object\" && !(matcher instanceof RegExp)) {\n return matcher[bundler] ?? false;\n }\n return matcher;\n}\n\nfunction testPluginName(matcher: PluginNameMatcher, name: string): boolean {\n if (matcher instanceof RegExp) {\n return matcher.test(name);\n }\n\n return matcher(name);\n}\n\nfunction toArray(name: string | readonly string[] | null | undefined) {\n if (name == null) {\n return [];\n }\n return Array.isArray(name) ? name : [name];\n}\n\nfunction reorder<T>(\n array: T[],\n getName: (item: T) => string | readonly string[] | null | undefined,\n itemNameToMove: string,\n matcher: PluginNameMatcher,\n): void {\n const itemIndex = array.findIndex((item) =>\n toArray(getName(item)).includes(itemNameToMove),\n );\n if (itemIndex === -1) {\n return;\n }\n\n const matchIndex = array\n .map((item) => toArray(getName(item)))\n .findIndex((names) => names.some((name) => testPluginName(matcher, name)));\n if (matchIndex === -1) {\n return;\n }\n\n if (itemIndex < matchIndex) {\n return;\n }\n\n const [item] = array.splice(itemIndex, 1);\n array.splice(matchIndex, 0, item);\n}\n\nexport const unpluginFactory: UnpluginFactory<\n StripWhitespaceOptions | undefined\n> = (options) => {\n initWasmOnce();\n\n const {\n selectLanguage: rawSelectLanguage = defaultLanguageSelector,\n preserveBlankLines: rawPreserveBlankLines = false,\n movePluginBefore: rawMovePluginBefore = /^astro:build|^vite-plugin-svelte$/,\n skipOnError = false,\n } = options ?? {};\n\n const selectLanguage = Array.isArray(rawSelectLanguage)\n ? createLanguageSelectorFromArray(rawSelectLanguage)\n : (rawSelectLanguage as Exclude<typeof rawSelectLanguage, readonly any[]>);\n\n return {\n name: UNPLUGIN_NAME,\n enforce: \"pre\",\n transform: {\n // Apply default filter only if using default language selector\n filter:\n selectLanguage === defaultLanguageSelector\n ? {\n id: {\n include: [/\\.astro$/, /\\.svelte$/],\n exclude: [/\\?/],\n },\n }\n : undefined,\n async handler(code, id) {\n const language = selectLanguage(id, code);\n if (!language) {\n return null;\n }\n\n const preserveBlankLines =\n typeof rawPreserveBlankLines === \"function\"\n ? rawPreserveBlankLines(language, id, code)\n : rawPreserveBlankLines;\n\n try {\n const result = stripWhitespace(code, id, language, {\n preserveBlankLines,\n });\n if (result.code === code) {\n // No changes\n return null;\n }\n\n return result;\n } catch (err) {\n if (skipOnError) {\n this.warn(`failed to process ${id}, skipping. Error: ${err}`);\n return null;\n }\n\n this.error(`failed to process ${id}. Error: ${err}`);\n throw err;\n }\n },\n },\n // Plugin reordering for various bundlers\n esbuild: {\n config(options) {\n const matcher = resolvePluginMatcher(rawMovePluginBefore, \"esbuild\");\n if (!matcher || !options.plugins) {\n return;\n }\n reorder(\n options.plugins,\n (plugin) => plugin.name,\n UNPLUGIN_NAME,\n matcher,\n );\n },\n },\n farm: {\n configResolved(config) {\n const matcher = resolvePluginMatcher(rawMovePluginBefore, \"farm\");\n if (!matcher || !config.jsPlugins) {\n return;\n }\n reorder(\n config.jsPlugins,\n (plugin) => plugin.name,\n UNPLUGIN_NAME,\n matcher,\n );\n },\n },\n unloader: {\n options(config) {\n const matcher = resolvePluginMatcher(rawMovePluginBefore, \"unloader\");\n if (!matcher || !config.plugins) {\n return;\n }\n reorder(\n config.plugins,\n (plugin) => plugin.name,\n UNPLUGIN_NAME,\n matcher,\n );\n },\n },\n rolldown: {\n options(config) {\n const matcher = resolvePluginMatcher(rawMovePluginBefore, \"rolldown\");\n if (!matcher || !config.plugins || !Array.isArray(config.plugins)) {\n return;\n }\n type PluginWithName = Exclude<\n (typeof config.plugins)[number],\n | Promise<any>\n | any[]\n | { _parallel: any }\n | false\n | void\n | null\n | undefined\n >;\n const flatten = (\n plugin: (typeof config.plugins)[number],\n ): PluginWithName[] => {\n if (!plugin || plugin instanceof Promise || \"_parallel\" in plugin) {\n return [];\n }\n if (Array.isArray(plugin)) {\n return plugin.flatMap(flatten);\n }\n return [plugin];\n };\n reorder(\n config.plugins,\n (plugin) => flatten(plugin).map((p) => p.name),\n UNPLUGIN_NAME,\n matcher,\n );\n },\n },\n rollup: {\n options(config) {\n const matcher = resolvePluginMatcher(rawMovePluginBefore, \"rollup\");\n if (!matcher || !config.plugins || !Array.isArray(config.plugins)) {\n return;\n }\n type PluginWithName = Exclude<\n (typeof config.plugins)[number],\n Promise<any> | any[] | false | void | null | undefined\n >;\n const flatten = (\n plugin: (typeof config.plugins)[number],\n ): PluginWithName[] => {\n if (!plugin || plugin instanceof Promise) {\n return [];\n }\n if (Array.isArray(plugin)) {\n return plugin.flatMap(flatten);\n }\n return [plugin];\n };\n reorder(\n config.plugins,\n (plugin) => flatten(plugin).map((p) => p.name),\n UNPLUGIN_NAME,\n matcher,\n );\n },\n },\n vite: {\n configResolved(config) {\n const matcher = resolvePluginMatcher(rawMovePluginBefore, \"vite\");\n if (!matcher) {\n return;\n }\n reorder(\n config.plugins as (typeof config.plugins)[number][],\n (plugin) => plugin.name,\n UNPLUGIN_NAME,\n matcher,\n );\n },\n },\n // We don't support webpack and rspack reordering for now, since there seems no way to get plugin names there\n } satisfies UnpluginOptions;\n};\n\nexport const unplugin = /* #__PURE__ */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rB,MAAM,UAAU,qBAAqB,qBAAqB,OAAO;AACjE,OAAI,CAAC,QACH;AAEF,WACE,OAAO,UACN,WAAW,OAAO,MACnB,eACA,QACD;KAEJ;EAEF;;AAGH,MAAa,WAA2B,+BAAe,gBAAgB;AAEvE,kBAAe"}
@@ -0,0 +1,60 @@
1
+ //#region src/types.d.ts
2
+ /**
3
+ * Supported languages for whitespace stripping.
4
+ */
5
+ type Language = "astro" | "svelte";
6
+ /**
7
+ * Kinds of bundlers where plugin reordering is supported.
8
+ *
9
+ * We don't support webpack and rspack reordering for now, since there seems no way to get plugin names there.
10
+ */
11
+ type ReorderableBundlerKind = "esbuild" | "farm" | "rolldown" | "rollup" | "unloader" | "vite";
12
+ /**
13
+ * A matcher for plugin names, used to identify plugins for reordering.
14
+ */
15
+ type PluginNameMatcher = RegExp | ((name: string) => boolean);
16
+ /**
17
+ * Options for the strip-whitespace plugin.
18
+ */
19
+ interface StripWhitespaceOptions {
20
+ /**
21
+ * A list of languages or a function to select which languages to process.
22
+ *
23
+ * If a function is provided, it receives the file ID and content, and should return a language or null to skip.
24
+ * If an array is provided, only files with matching languages will be processed.
25
+ *
26
+ * By default, the plugin processes `.astro` and `.svelte` files excluding those in `node_modules` or with query parameters.
27
+ *
28
+ * @default defaultLanguageSelector
29
+ */
30
+ readonly selectLanguage?: readonly Language[] | ((id: string, content: string) => Language | false) | undefined;
31
+ /**
32
+ * If true, preserves "section breaks" by skipping gaps that contain an empty line.
33
+ *
34
+ * @default false
35
+ */
36
+ readonly preserveBlankLines?: boolean | ((lang: Language, id: string, content: string) => boolean) | undefined;
37
+ /**
38
+ * A regular expression to match plugins before which the strip-whitespace plugin should be moved.
39
+ * If set to `false`, the plugin will not be moved.
40
+ * Default is to move before plugins that handle Astro or Svelte files.
41
+ *
42
+ * Availability and behavior of plugin reordering differs across bundlers; in some cases this option may be ignored.
43
+ *
44
+ * When providing an object, keys are bundler kinds and values are matchers specific to that bundler.
45
+ * If a bundler is not specified in the object, the plugin will not be moved for that bundler. (i.e. equivalent to `false`)
46
+ *
47
+ * @default /^astro:build|^vite-plugin-svelte$/
48
+ */
49
+ readonly movePluginBefore?: PluginNameMatcher | false | Partial<Record<ReorderableBundlerKind, PluginNameMatcher | false | undefined>> | undefined;
50
+ /**
51
+ * If true, skips whitespace stripping if an error occurs during processing.
52
+ * If false, errors will be thrown.
53
+ *
54
+ * @default false
55
+ */
56
+ readonly skipOnError?: boolean | undefined;
57
+ }
58
+ //#endregion
59
+ export { Language, PluginNameMatcher, ReorderableBundlerKind, StripWhitespaceOptions };
60
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;AAGA;AAOA;AAWY,KAlBA,QAAA,GAkBA,OAAiB,GAAA,QAAG;AAKhC;;;;;AA0Ce,KA1DH,sBAAA,GA0DG,SAAA,GAAA,MAAA,GAAA,UAAA,GAAA,QAAA,GAAA,UAAA,GAAA,MAAA;;;;AADF,KA9CD,iBAAA,GAAoB,MA8CnB,GAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA,OAAA,CAAA;;;;UAzCI,sBAAA;;;;;;;;;;;qCAYF,+CACyB;;;;;;kDAU1B;;;;;;;;;;;;;8BAgBR,4BAEA,QACE,OAAO,wBAAwB"}
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,8 @@
1
+ import { StripWhitespaceOptions } from "./types.mjs";
2
+ import * as unplugin0 from "unplugin";
3
+
4
+ //#region src/vite.d.ts
5
+ declare const _default: (options?: StripWhitespaceOptions | undefined) => unplugin0.VitePlugin<any> | unplugin0.VitePlugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
8
+ //# sourceMappingURL=vite.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.d.mts","names":[],"sources":["../src/vite.ts"],"sourcesContent":[],"mappings":""}
package/dist/vite.mjs ADDED
@@ -0,0 +1,9 @@
1
+ import { i as unpluginFactory } from "./src-KUYBObHk.mjs";
2
+ import { createVitePlugin } from "unplugin";
3
+
4
+ //#region src/vite.ts
5
+ var vite_default = createVitePlugin(unpluginFactory);
6
+
7
+ //#endregion
8
+ export { vite_default as default };
9
+ //# sourceMappingURL=vite.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.mjs","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createVitePlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,mBAAe,iBAAiB,gBAAgB"}
@@ -0,0 +1,8 @@
1
+ import { StripWhitespaceOptions } from "./types.mjs";
2
+ import * as webpack0 from "webpack";
3
+
4
+ //#region src/webpack.d.ts
5
+ declare const _default: (options?: StripWhitespaceOptions | undefined) => webpack0.WebpackPluginInstance;
6
+ //#endregion
7
+ export { _default as default };
8
+ //# sourceMappingURL=webpack.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack.d.mts","names":[],"sources":["../src/webpack.ts"],"sourcesContent":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { i as unpluginFactory } from "./src-KUYBObHk.mjs";
2
+ import { createWebpackPlugin } from "unplugin";
3
+
4
+ //#region src/webpack.ts
5
+ var webpack_default = createWebpackPlugin(unpluginFactory);
6
+
7
+ //#endregion
8
+ export { webpack_default as default };
9
+ //# sourceMappingURL=webpack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack.mjs","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import { createWebpackPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createWebpackPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,sBAAe,oBAAoB,gBAAgB"}
package/package.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ "name": "unplugin-strip-whitespace",
3
+ "version": "0.2.0",
4
+ "description": "Unplugin to strip inter-node whitespace in Astro and Svelte templates (Vite/Rollup/Webpack/Rspack/etc).",
5
+ "license": "MIT",
6
+ "author": "SegaraRai",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/SegaraRai/strip-whitespace.git",
10
+ "directory": "packages/unplugin-strip-whitespace"
11
+ },
12
+ "homepage": "https://github.com/SegaraRai/strip-whitespace#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/SegaraRai/strip-whitespace/issues"
15
+ },
16
+ "keywords": [
17
+ "unplugin",
18
+ "vite",
19
+ "rollup",
20
+ "webpack",
21
+ "rspack",
22
+ "esbuild",
23
+ "farm",
24
+ "nuxt",
25
+ "astro",
26
+ "svelte",
27
+ "whitespace",
28
+ "minify"
29
+ ],
30
+ "type": "module",
31
+ "sideEffects": false,
32
+ "main": "./dist/index.mjs",
33
+ "module": "./dist/index.mjs",
34
+ "types": "./dist/index.d.mts",
35
+ "exports": {
36
+ ".": "./dist/index.mjs",
37
+ "./esbuild": "./dist/esbuild.mjs",
38
+ "./farm": "./dist/farm.mjs",
39
+ "./nuxt": "./dist/nuxt.mjs",
40
+ "./rollup": "./dist/rollup.mjs",
41
+ "./rspack": "./dist/rspack.mjs",
42
+ "./types": "./dist/types.mjs",
43
+ "./vite": "./dist/vite.mjs",
44
+ "./webpack": "./dist/webpack.mjs",
45
+ "./package.json": "./package.json"
46
+ },
47
+ "imports": {
48
+ "#wasm": "./src/internal/wasm.ts"
49
+ },
50
+ "files": [
51
+ "dist",
52
+ "README.md",
53
+ "LICENSE"
54
+ ],
55
+ "dependencies": {
56
+ "unplugin": "^2.3.11"
57
+ },
58
+ "devDependencies": {
59
+ "@arethetypeswrong/core": "^0.18.2",
60
+ "@farmfe/core": "^1.7.11",
61
+ "@nuxt/kit": "^4.2.2",
62
+ "@nuxt/schema": "^4.2.2",
63
+ "@rspack/core": "^1.7.1",
64
+ "@types/node": "^25.0.6",
65
+ "astro": "^5.16.8",
66
+ "prettier": "^3.7.4",
67
+ "prettier-plugin-organize-imports": "^4.3.0",
68
+ "rolldown": "1.0.0-beta.59",
69
+ "rollup": "^4.55.1",
70
+ "tsdown": "^0.19.0",
71
+ "typescript": "^5.9.3",
72
+ "unloader": "^0.8.3",
73
+ "vitest": "^4.0.16",
74
+ "webpack": "^5.104.1",
75
+ "strip-whitespace-wasm": "0.1.0"
76
+ },
77
+ "peerDependencies": {
78
+ "@farmfe/core": "^1",
79
+ "@nuxt/kit": "^3 || ^4",
80
+ "@nuxt/schema": "^3 || ^4",
81
+ "esbuild": "*",
82
+ "rollup": "^3 || ^4",
83
+ "vite": ">=3",
84
+ "webpack": "^4 || ^5"
85
+ },
86
+ "peerDependenciesMeta": {
87
+ "@farmfe/core": {
88
+ "optional": true
89
+ },
90
+ "@nuxt/kit": {
91
+ "optional": true
92
+ },
93
+ "@nuxt/schema": {
94
+ "optional": true
95
+ },
96
+ "esbuild": {
97
+ "optional": true
98
+ },
99
+ "rollup": {
100
+ "optional": true
101
+ },
102
+ "vite": {
103
+ "optional": true
104
+ },
105
+ "webpack": {
106
+ "optional": true
107
+ }
108
+ },
109
+ "scripts": {
110
+ "build": "tsdown",
111
+ "test": "vitest run"
112
+ }
113
+ }