quickbundle 0.0.0-next-6c096f7

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) Ayoub Adib
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,164 @@
1
+ <br>
2
+ <div align="center">
3
+ <h1>📦 Quickbundle</h1>
4
+ <strong>The zero-configuration transpiler and bundler for the web</strong>
5
+ </div>
6
+ <br>
7
+ <br>
8
+
9
+ ## ✨ Features
10
+
11
+ Quickbundle allows you to bundle a library in a **quick**, **fast** and **easy** way:
12
+
13
+ - Fast build and watch mode powered by Rollup[^1] and SWC[^2].
14
+ - Zero configuration: define the build artifacts in your `package.json`, and you're all set!
15
+ - Support of `cjs` & `esm` module formats output.
16
+ - Support of several loaders including JavaScript, TypeScript, JSX, JSON, and Images.
17
+ - TypeScript's declaration file (`.d.ts`) bundling.
18
+ - Automatic dependency inclusion (`peerDependencies` and `dependencies` are not bundled in the final output, `devDependencies` are unless they're not imported).
19
+
20
+ [^1]: A [module bundler](https://rollupjs.org/) optimized for better tree-shaking processing and seamless interoperability of CommonJS and ESM formats with minimal code footprint.
21
+
22
+ [^2]: A [TypeScript / JavaScript transpiler](https://swc.rs/) for quicker code processing including TypeScript transpilation, JavaScript transformation, and, minification.
23
+
24
+ <br>
25
+
26
+ ## 🚀 Quick Start
27
+
28
+ 1️⃣ Install by running:
29
+
30
+ ```bash
31
+ # Npm
32
+ npm install quickbundle
33
+ # Pnpm
34
+ pnpm add quickbundle
35
+ # Yarn
36
+ yarn add quickbundle
37
+ ```
38
+
39
+ 2️⃣ Set up your package configuration (`package.json`):
40
+
41
+ - When exporting exclusively ESM format:
42
+
43
+ ```jsonc
44
+ {
45
+ "name": "lib", // Package name
46
+ "type": "module", // Optional if you want Node-like runtime to process by default `.js` file as ESM modules.
47
+ "sideEffects": false, // Mark the package as a side-effect-free one to support the consumer dead-code elimination (tree-shaking) process. If your library contains global side effects (ideally, it should be avoided), configure the field to list the files that do have side effects.
48
+ "exports": {
49
+ ".": {
50
+ "source": "src/index.ts(x)?", // Source code entry point.
51
+ "types": "./dist/index.d.ts", // Typing output file (if defined, can increase build time). This condition should always come first after the custom `source` field definition.
52
+ "default": "./dist/index.mjs", // By default, Quickbundle will always output ESM format for the `default` field (this condition should always come last since it always matches as a generic fallback). However, take care: if both `import` and `default` fields are defined, provide the same file path, as the `import` field export instruction will be the only one considered to define the output file path.
53
+ },
54
+ "./otherModulePath": {
55
+ // ...
56
+ }
57
+ }
58
+ "scripts": {
59
+ "build": "quickbundle build", // Production mode (optimizes bundle)
60
+ "watch": "quickbundle watch", // Development mode (watches each file change)
61
+ },
62
+ // ...
63
+ }
64
+ ```
65
+
66
+ - When exporting both CommonJS (CJS) and ECMAScript Modules (ESM) format (please be aware of [dual package hazard risk](https://nodejs.org/api/packages.html#dual-package-hazard)):
67
+
68
+ ```jsonc
69
+ {
70
+ "name": "lib", // Package name
71
+ "type": "module", // Optional if you want Node-like runtime to process by default `.js` file as ESM modules.
72
+ "sideEffects": false, // Mark the package as a side-effect-free one to support the consumer dead-code elimination (tree-shaking) process. If your library contains global side effects (ideally, it should be avoided), configure the field to list the files that do have side effects.
73
+ "exports": {
74
+ ".": {
75
+ "source": "src/index.ts(x)?", // Source code entry point.
76
+ "types": "./dist/index.d.ts", // // Typing output file (if defined, can increase build time). This condition should always come first after the custom `source` field definition.
77
+ "require": "./dist/index.cjs", // CommonJS output file (matches when the module is loaded via require() consumer side).
78
+ "import": "./dist/index.mjs", // ESM output file (matches when the package is loaded via import or import() consumer side).
79
+ "default": "./dist/index.mjs", // By default, Quickbundle will always output ESM format for the `default` field (this condition should always come last since it always matches as a generic fallback). However, take care: if both `import` and `default` fields are defined, provide the same file path, as the `import` field export instruction will be the only one considered to define the output file path.
80
+ },
81
+ "./otherModulePath": {
82
+ // ...
83
+ }
84
+ }
85
+ "scripts": {
86
+ "build": "quickbundle build", // Production mode (optimizes bundle)
87
+ "watch": "quickbundle watch", // Development mode (watches each file change)
88
+ },
89
+ // ...
90
+ }
91
+ ```
92
+
93
+ 3️⃣ Try it by running:
94
+
95
+ ```bash
96
+ # Npm
97
+ npm run build
98
+ # Pnpm
99
+ pnpm build
100
+ # Yarn
101
+ yarn build
102
+ ```
103
+
104
+ <br>
105
+
106
+ ## 👨‍🍳 Patterns
107
+
108
+ ### Optimize the build output
109
+
110
+ By default, Quickbundle does the following built-in optimizations during the bundling process:
111
+
112
+ - Include, in the build output, only the code that is effectively imported and used in the source code. Setting the `sideEffects` package.json field to `false` marks the package as a side-effect-free one and helps Quickbundle to safely prune unused exports.
113
+ - [Identify and annotate](https://rollupjs.org/configuration-options/#treeshake-annotations) side-effect-free code (functions, ...) to enable a fine-grained dead-code elimination process later consumer side. For example, if a consumer uses only one library API, build output annotations added by Quickbundle allow the consumer's bundler remove all other unused APIs.
114
+
115
+ However, Quickbundle doesn't minify the build output. Indeed, in general, **if the build targets a library (the most Quickbundle use case)**, minification is not necessary since enabling it can introduce some challenges:
116
+
117
+ - Reduce the build output discoverability inside the `node_modules` folder (minified code is an obfuscated code that can be hard to read for code audit/debugging purposes).
118
+ - Generate suboptimal source maps for the bundled library, as the consumer bundler will generate source maps based on the already minified library build (transformed code, mangled variable names, etc.).
119
+ - Risk of side effects with double optimizations (producer side and then consumer side).
120
+
121
+ Popular open source libraries ([Vue](https://unpkg.com/browse/vue@3.4.24/dist/), [SolidJS](https://unpkg.com/browse/solid-js@1.8.17/dist/), [Material UI](https://unpkg.com/browse/@material-ui/core@4.12.4/), ...) do not provide minified builds as the build optimization is sensitive to the consumer context (e.g. environment targets (browser support), ...) and needs to be fully owned upstream (i.e. consumer/application-side).
122
+
123
+ However, for non-library targets or if you would like to minify the build output on your side anyway, Quickbundle still provides the ability to enable the minification via:
124
+
125
+ ```bash
126
+ quickbundle build --minification
127
+ quickbundle watch --minification
128
+ ```
129
+
130
+ ### Enable source maps generation
131
+
132
+ By default, source maps are not enabled but Quickbundle still provides the ability to enable it via:
133
+
134
+ ```bash
135
+ quickbundle build --source-maps
136
+ quickbundle watch --source-maps
137
+ ```
138
+
139
+ Enabling source map generation is needed only if a build is [obfuscated (minified)](#optimize-the-build-output) for debugging-easing purposes. It generally pairs with the [`minification` flag](#optimize-the-build-output).
140
+
141
+ <br>
142
+
143
+ ## 🤩 Used by
144
+
145
+ - [@adbayb/stack](https://github.com/adbayb/stack) My opinionated toolbox for JavaScript/TypeScript projects.
146
+
147
+ <br>
148
+
149
+ ## ✍️ Contribution
150
+
151
+ We're open to new contributions, you can find more details [here](./CONTRIBUTING.md).
152
+
153
+ <br>
154
+
155
+ ## 💙 Acknowledgements
156
+
157
+ - The backend is powered by [Rollup](https://github.com/rollup/rollup) and its plugin ecosystem (including [SWC](https://github.com/swc-project/swc)) to make blazing-fast builds. A special shoutout to all contributors involved.
158
+ - The zero-configuration approach was inspired by [microbundle](https://github.com/developit/microbundle). A special shoutout to its author [Jason Miller](https://github.com/developit) and [all contributors](https://github.com/developit/microbundle/graphs/contributors).
159
+
160
+ <br>
161
+
162
+ ## 📖 License
163
+
164
+ [MIT](./LICENSE "License MIT").
package/bin/index.mjs ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createRequire } from "node:module";
4
+ import { join } from "node:path";
5
+
6
+ const pkg = createRequire(import.meta.url)("../package.json");
7
+
8
+ import(join("..", pkg.exports["."].default));
package/dist/index.mjs ADDED
@@ -0,0 +1,365 @@
1
+ #!/usr/bin/env node
2
+ import { helpers, termost } from 'termost';
3
+ import { gzipSize } from 'gzip-size';
4
+ import { rollup, watch as watch$1 } from 'rollup';
5
+ import commonjs from '@rollup/plugin-commonjs';
6
+ import json from '@rollup/plugin-json';
7
+ import { nodeResolve } from '@rollup/plugin-node-resolve';
8
+ import url from '@rollup/plugin-url';
9
+ import { createRequire } from 'node:module';
10
+ import { join } from 'node:path';
11
+ import dts from 'rollup-plugin-dts';
12
+ import externals from 'rollup-plugin-node-externals';
13
+ import { swc } from 'rollup-plugin-swc3';
14
+ import { readFile as readFile$1 } from 'node:fs/promises';
15
+
16
+ const onLog = (_, log)=>{
17
+ if (log.message.includes("Generated an empty chunk")) return;
18
+ };
19
+ const isRecord = (value)=>{
20
+ return typeof value === "object" && value !== null && !Array.isArray(value);
21
+ };
22
+
23
+ const build = async (configurations)=>{
24
+ process.env.NODE_ENV ??= "production";
25
+ const output = [];
26
+ for (const config of configurations){
27
+ const initialTime = Date.now();
28
+ const bundle = await rollup({
29
+ ...config,
30
+ onLog
31
+ });
32
+ if (config.output) {
33
+ const outputEntries = Array.isArray(config.output) ? config.output : [
34
+ config.output
35
+ ];
36
+ const promises = [];
37
+ for (const outputEntry of outputEntries){
38
+ const outputFilename = outputEntry.file ?? outputEntry.dir;
39
+ if (!outputFilename) {
40
+ throw new Error("Misconfigured file entry point. Make sure to define an `import`, `require`, or `default` field.");
41
+ }
42
+ promises.push(new Promise((resolve, reject)=>{
43
+ bundle.write(outputEntry).then(()=>{
44
+ resolve({
45
+ elapsedTime: Date.now() - initialTime,
46
+ filename: outputFilename
47
+ });
48
+ }).catch(reject);
49
+ }));
50
+ }
51
+ output.push(...await Promise.all(promises));
52
+ }
53
+ }
54
+ return output;
55
+ };
56
+
57
+ const CWD = process.cwd();
58
+
59
+ const require = createRequire(import.meta.url);
60
+ const PKG = require(join(CWD, "./package.json"));
61
+ const createConfigurations = (options = {
62
+ minification: false,
63
+ sourceMaps: false,
64
+ standalone: false
65
+ })=>{
66
+ return getBuildableExports(options).flatMap((buildableExport)=>{
67
+ return [
68
+ buildableExport.source && createMainConfig({
69
+ ...buildableExport,
70
+ source: buildableExport.source
71
+ }, options),
72
+ buildableExport.source && buildableExport.types && createTypesConfig({
73
+ source: buildableExport.source,
74
+ types: buildableExport.types
75
+ })
76
+ ].filter(Boolean);
77
+ });
78
+ };
79
+ const getBuildableExports = ({ standalone })=>{
80
+ if (standalone) {
81
+ /**
82
+ * Entry-point resolution invariants for standalone target (mostly binaries).
83
+ */ if (!PKG.source || !PKG.bin) {
84
+ throw new Error("Invalid package entry points contract. Standalone compilation is enabled but required fields `source` and/or `bin` are missing. Make sure to set them.");
85
+ }
86
+ const bin = PKG.bin;
87
+ return isRecord(bin) ? Object.entries(bin).map((data)=>({
88
+ require: data[1],
89
+ source: data[0]
90
+ })) : [
91
+ {
92
+ require: bin,
93
+ source: PKG.source
94
+ }
95
+ ];
96
+ }
97
+ /**
98
+ * Entry-point resolution invariants for non-standalone target (mostly libraries):
99
+ * Following the [package entry-point specification](https://nodejs.org/api/packages.html#package-entry-points),
100
+ * whenever an export object is defined, it take precedence over other classical entry-point fields
101
+ * (such as main, module, and types defined at the root package.json level).
102
+ */ if (PKG.main ?? PKG.module ?? PKG.types ?? !PKG.exports) {
103
+ throw new Error("Invalid package entry points contract. Use the recommended [`exports` field](https://nodejs.org/api/packages.html#package-entry-points) instead and, for TypeScript-based projects, update the `tsconfig.json` file to resolve it properly (`moduleResolution` must be set to `Bundler` (or `NodeNext`)).");
104
+ }
105
+ const buildableExportFields = [
106
+ "default",
107
+ "import",
108
+ "require",
109
+ "types"
110
+ ];
111
+ let singleExport = undefined;
112
+ const output = Object.entries(PKG.exports).map(([field, value])=>{
113
+ if (isRecord(value)) {
114
+ return [
115
+ field,
116
+ value
117
+ ];
118
+ }
119
+ if ([
120
+ "source",
121
+ ...buildableExportFields
122
+ ].includes(field)) {
123
+ if (!singleExport) {
124
+ singleExport = {};
125
+ singleExport[field] = value;
126
+ return [
127
+ ".",
128
+ singleExport
129
+ ];
130
+ }
131
+ singleExport[field] = value;
132
+ }
133
+ return undefined;
134
+ }).reduce((buildableExports, currentExport)=>{
135
+ if (!currentExport) return buildableExports;
136
+ const [exportField, exportValue] = currentExport;
137
+ const conditionalExportFields = Object.keys(exportValue);
138
+ if (!conditionalExportFields.includes("source")) return buildableExports;
139
+ const hasAtLeastOneRequiredField = buildableExportFields.some((entryPointField)=>conditionalExportFields.includes(entryPointField));
140
+ if (hasAtLeastOneRequiredField) {
141
+ buildableExports.push(exportValue);
142
+ return buildableExports;
143
+ }
144
+ throw new Error(`A \`source\` field is defined without an output defined for the \`${exportField}\` export. Make sure to define at least one conditional entry point (including ${buildableExportFields.map((field)=>`\`${field}\``).join(", ")})`);
145
+ }, []);
146
+ if (output.length === 0) {
147
+ throw new Error("No `source` field is set for the targeted package. If a build step is necessary, make sure to configure at least one `source` field in the package `exports` contract. If not, do not execute quickbundle on this package.");
148
+ }
149
+ return output;
150
+ };
151
+ const getPlugins = (...customPlugins)=>{
152
+ return [
153
+ externals({
154
+ builtins: true,
155
+ deps: true,
156
+ /**
157
+ * As they're not installed consumer side, `devDependencies` are declared as internal dependencies (via the `false` value)
158
+ * and bundled into the dist if and only if imported and not listed as `peerDependencies` (otherwise, they're considered external).
159
+ */ devDeps: false,
160
+ optDeps: true,
161
+ peerDeps: true
162
+ }),
163
+ commonjs(),
164
+ url(),
165
+ json(),
166
+ ...customPlugins
167
+ ];
168
+ };
169
+ const createMainConfig = (entryPoints, options)=>{
170
+ const { minification, sourceMaps } = options;
171
+ const esmInput = entryPoints.import ?? entryPoints.default;
172
+ if (entryPoints.import && entryPoints.default && entryPoints.import !== entryPoints.default) {
173
+ throw new Error("Both `import` and `default` export fields have been defined but with different values. To preserve proper `default` field resolution on the consumer side (i.e. to target ESM format), make sure to provide the same file path for both fields.");
174
+ }
175
+ const output = [
176
+ entryPoints.require && {
177
+ file: entryPoints.require,
178
+ format: "cjs",
179
+ inlineDynamicImports: Boolean(options.standalone),
180
+ sourcemap: sourceMaps
181
+ },
182
+ esmInput && {
183
+ file: esmInput,
184
+ format: "es",
185
+ sourcemap: sourceMaps
186
+ }
187
+ ].filter(Boolean);
188
+ return {
189
+ input: entryPoints.source,
190
+ output,
191
+ plugins: getPlugins(nodeResolve(), swc({
192
+ minify: minification,
193
+ sourceMaps
194
+ }))
195
+ };
196
+ };
197
+ const createTypesConfig = (entryPoints)=>{
198
+ return {
199
+ input: entryPoints.source,
200
+ output: [
201
+ {
202
+ file: entryPoints.types
203
+ }
204
+ ],
205
+ plugins: getPlugins(nodeResolve({
206
+ /**
207
+ * The `exports` conditional fields definition order is important in the `package.json file`.
208
+ * To be resolved first, `types` field must always come first in the package.json exports definition.
209
+ * @see https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing.
210
+ */ exportConditions: [
211
+ "types"
212
+ ]
213
+ }), dts({
214
+ compilerOptions: {
215
+ incremental: false
216
+ },
217
+ respectExternal: true
218
+ }))
219
+ };
220
+ };
221
+ // eslint-disable-next-line import/no-default-export
222
+ createConfigurations();
223
+
224
+ const readFile = readFile$1;
225
+ const createCommand = (program, input)=>{
226
+ return program.command(input).option({
227
+ key: "minification",
228
+ name: "minification",
229
+ description: "Enable minification",
230
+ defaultValue: false
231
+ }).option({
232
+ key: "sourceMaps",
233
+ name: "source-maps",
234
+ description: "Enable source maps generation",
235
+ defaultValue: false
236
+ });
237
+ };
238
+
239
+ const createBuildCommand = (program)=>{
240
+ return createCommand(program, {
241
+ name: "build",
242
+ description: "Build the source code (production mode)"
243
+ }).task({
244
+ key: "buildOutput",
245
+ label: "Bundle assets 📦",
246
+ async handler (context) {
247
+ return build(createConfigurations({
248
+ minification: context.minification,
249
+ sourceMaps: context.sourceMaps,
250
+ standalone: false
251
+ }));
252
+ }
253
+ }).task({
254
+ key: "logInput",
255
+ label: "Generate report 📝",
256
+ async handler (context) {
257
+ return computeBundleSize(context.buildOutput);
258
+ },
259
+ skip (context) {
260
+ return context.buildOutput.length === 0;
261
+ }
262
+ }).task({
263
+ handler (context) {
264
+ context.logInput.forEach((item)=>{
265
+ helpers.message([
266
+ `${formatSize(item.rawSize)} raw`,
267
+ `${formatSize(item.compressedSize)} gzip`
268
+ ].map((message, index)=>{
269
+ return index === 0 ? message : ` ${message}`;
270
+ }).join("\n"), {
271
+ label: `${item.filename} (took ${item.elapsedTime}ms)`,
272
+ type: "information"
273
+ });
274
+ });
275
+ },
276
+ skip (context) {
277
+ return context.buildOutput.length === 0;
278
+ }
279
+ });
280
+ };
281
+ const computeBundleSize = async (buildOutput)=>{
282
+ const computeFileSize = async (buildItemOutput)=>{
283
+ const content = await readFile(buildItemOutput.filename);
284
+ const gzSize = await gzipSize(content);
285
+ return {
286
+ ...buildItemOutput,
287
+ compressedSize: gzSize,
288
+ rawSize: content.byteLength
289
+ };
290
+ };
291
+ return Promise.all(buildOutput.map(async (item)=>computeFileSize(item)));
292
+ };
293
+ const formatSize = (bytes)=>{
294
+ const kiloBytes = bytes / 1000;
295
+ return kiloBytes < 1 ? `${bytes} B` : `${kiloBytes.toFixed(2)} kB`;
296
+ };
297
+
298
+ const watch = (configurations)=>{
299
+ process.env.NODE_ENV ??= "development";
300
+ const watcher = watch$1(configurations.map((config)=>({
301
+ ...config,
302
+ onLog
303
+ })));
304
+ let startDuration;
305
+ console.clear();
306
+ watcher.on("event", async (event)=>{
307
+ switch(event.code){
308
+ case "START":
309
+ {
310
+ startDuration = Date.now();
311
+ clearLog(`Build in progress...`, {
312
+ type: "information"
313
+ });
314
+ return;
315
+ }
316
+ case "BUNDLE_END":
317
+ await event.result.close();
318
+ break;
319
+ case "END":
320
+ {
321
+ const duration = Date.now() - startDuration;
322
+ clearLog(`Build done in ${duration}ms (at ${new Date().toLocaleTimeString()})`, {
323
+ type: "success"
324
+ });
325
+ return;
326
+ }
327
+ case "ERROR":
328
+ {
329
+ const { error } = event;
330
+ clearLog(`${String(error)}`, {
331
+ type: "error"
332
+ });
333
+ console.error("\n", error);
334
+ return;
335
+ }
336
+ }
337
+ });
338
+ };
339
+ const clearLog = (...input)=>{
340
+ console.clear();
341
+ helpers.message(...input);
342
+ };
343
+
344
+ const createWatchCommand = (program)=>{
345
+ return createCommand(program, {
346
+ name: "watch",
347
+ description: "Watch and rebuild on any code change (development mode)"
348
+ }).task({
349
+ handler (context) {
350
+ watch(createConfigurations({
351
+ minification: context.minification,
352
+ sourceMaps: context.sourceMaps,
353
+ standalone: false
354
+ }));
355
+ }
356
+ });
357
+ };
358
+
359
+ const createProgram = (...commandBuilders)=>{
360
+ const program = termost("The zero-configuration transpiler and bundler for the web");
361
+ for (const commandBuilder of commandBuilders){
362
+ commandBuilder(program);
363
+ }
364
+ };
365
+ createProgram(createBuildCommand, createWatchCommand);
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "quickbundle",
3
+ "version": "0.0.0-next-6c096f7",
4
+ "description": "The zero-configuration transpiler and bundler for the web",
5
+ "author": {
6
+ "name": "Ayoub Adib",
7
+ "email": "adbayb@gmail.com",
8
+ "url": "https://twitter.com/adbayb"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git@github.com:adbayb/quickbundle.git",
13
+ "directory": "quickbundle"
14
+ },
15
+ "license": "MIT",
16
+ "keywords": [
17
+ "library",
18
+ "bundle",
19
+ "build",
20
+ "compiler",
21
+ "transpiler",
22
+ "module",
23
+ "fast",
24
+ "esbuild",
25
+ "swc",
26
+ "microbundle"
27
+ ],
28
+ "bin": {
29
+ "quickbundle": "bin/index.mjs"
30
+ },
31
+ "files": [
32
+ "bin",
33
+ "dist"
34
+ ],
35
+ "type": "module",
36
+ "exports": {
37
+ ".": {
38
+ "source": "./src/index.ts",
39
+ "default": "./dist/index.mjs"
40
+ }
41
+ },
42
+ "peerDependencies": {
43
+ "typescript": ">=4.7.0"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "typescript": {
47
+ "optional": true
48
+ }
49
+ },
50
+ "dependencies": {
51
+ "@rollup/plugin-commonjs": "^28.0.1",
52
+ "@rollup/plugin-json": "^6.1.0",
53
+ "@rollup/plugin-node-resolve": "^15.3.0",
54
+ "@rollup/plugin-url": "^8.0.2",
55
+ "@swc/core": "^1.7.42",
56
+ "gzip-size": "^7.0.0",
57
+ "rollup": "^4.24.3",
58
+ "rollup-plugin-dts": "^6.1.1",
59
+ "rollup-plugin-node-externals": "^7.1.3",
60
+ "rollup-plugin-swc3": "^0.12.1",
61
+ "termost": "^0.18.0"
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "22.8.5"
65
+ },
66
+ "scripts": {
67
+ "build": "rollup --config ./src/bundler/config.ts --configPlugin rollup-plugin-swc3",
68
+ "watch": "rollup --watch --config ./src/bundler/config.ts --configPlugin rollup-plugin-swc3"
69
+ }
70
+ }