quickbundle 0.0.0-next-d98c547 → 0.0.0-next-1088d34
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 +19 -20
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,24 +11,26 @@
|
|
|
11
11
|
Quickbundle allows you to bundle a library in a **quick**, **fast** and **easy** way:
|
|
12
12
|
|
|
13
13
|
- Fast build and watch mode powered by Rollup[^1] and SWC[^2].
|
|
14
|
-
- Compile mode to create
|
|
14
|
+
- Compile mode to create standalone binaries for systems that do not have Node.js installed[^3].
|
|
15
15
|
- Zero configuration: define the build artifacts in your `package.json`, and you're all set!
|
|
16
16
|
- Support of `cjs` & `esm` module formats output.
|
|
17
17
|
- Support of several loaders including JavaScript, TypeScript, JSX, JSON, and Images.
|
|
18
18
|
- TypeScript's declaration file (`.d.ts`) bundling.
|
|
19
19
|
- Automatic dependency inclusion:
|
|
20
|
-
- For the build
|
|
21
|
-
- For the compile mode
|
|
20
|
+
- For the build and watch mode, `peerDependencies` and `dependencies` are not bundled in the final output, `devDependencies` are unless they're not imported.
|
|
21
|
+
- For the compile mode, all dependencies are included to make the code standalone.
|
|
22
22
|
|
|
23
23
|
[^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.
|
|
24
24
|
|
|
25
25
|
[^2]: A [TypeScript / JavaScript transpiler](https://swc.rs/) for quicker code processing including TypeScript transpilation, JavaScript transformation, and, minification.
|
|
26
26
|
|
|
27
|
+
[^3]: It relies on [Node.js single executable applications feature](https://nodejs.org/api/single-executable-applications.html).
|
|
28
|
+
|
|
27
29
|
<br>
|
|
28
30
|
|
|
29
31
|
## 🚀 Quick Start
|
|
30
32
|
|
|
31
|
-
1️⃣ Install
|
|
33
|
+
### 1️⃣ Install
|
|
32
34
|
|
|
33
35
|
```bash
|
|
34
36
|
# Npm
|
|
@@ -39,10 +41,9 @@ pnpm add quickbundle
|
|
|
39
41
|
yarn add quickbundle
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
2️⃣
|
|
44
|
+
### 2️⃣ Update your package configuration (`package.json`)
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
<summary><strong>For building libraries</strong></summary>
|
|
46
|
+
#### For building libraries
|
|
46
47
|
|
|
47
48
|
- When exporting exclusively ESM format:
|
|
48
49
|
|
|
@@ -69,7 +70,10 @@ yarn add quickbundle
|
|
|
69
70
|
}
|
|
70
71
|
```
|
|
71
72
|
|
|
72
|
-
- When exporting both CommonJS (CJS) and ECMAScript Modules (ESM) format
|
|
73
|
+
- When exporting both CommonJS (CJS) and ECMAScript Modules (ESM) format:
|
|
74
|
+
|
|
75
|
+
> [!warning]
|
|
76
|
+
> Please be aware of [dual-package-hazard-related risks](https://nodejs.org/api/packages.html#dual-package-hazard) first.
|
|
73
77
|
|
|
74
78
|
```jsonc
|
|
75
79
|
{
|
|
@@ -96,10 +100,13 @@ yarn add quickbundle
|
|
|
96
100
|
}
|
|
97
101
|
```
|
|
98
102
|
|
|
99
|
-
|
|
103
|
+
#### For compiling executables
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
> [!warning]
|
|
106
|
+
> The `compile` command relies on the [Node.js SEA (Single Executable Applications)](https://nodejs.org/api/single-executable-applications.html). This feature comes with some limitations which Quickbundle attempts to address:
|
|
107
|
+
>
|
|
108
|
+
> - The source code must not rely on [external dependencies](https://github.com/nodejs/single-executable/discussions/70) 🛑. To partially address this, Quickbundle bundles all dependencies (whatever their types, as long as they're used) and inline dynamic imports by default ✅.
|
|
109
|
+
> - The bundled code must use the CommonJS module system 🛑. To address this, Quickbundle always outputs CJS modules in compile mode ✅.
|
|
103
110
|
|
|
104
111
|
```jsonc
|
|
105
112
|
{
|
|
@@ -116,15 +123,7 @@ yarn add quickbundle
|
|
|
116
123
|
}
|
|
117
124
|
```
|
|
118
125
|
|
|
119
|
-
|
|
120
|
-
> The `compile` command relies on the [Node.js SEA (Single Executable Applications)](https://nodejs.org/api/single-executable-applications.html). This feature comes with some limitations which Quickbundle attempts to address:
|
|
121
|
-
>
|
|
122
|
-
> - The source code must not rely on [external dependencies](https://github.com/nodejs/single-executable/discussions/70) 🛑. To partially address this, Quickbundle bundles all dependencies (whatever their types, as long as they're used) and inline dynamic imports by default ✅.
|
|
123
|
-
> - The bundled code must use the CommonJS module system 🛑. To address this, Quickbundle always outputs CJS modules in compile mode ✅.
|
|
124
|
-
|
|
125
|
-
</details>
|
|
126
|
-
|
|
127
|
-
3️⃣ Try it by running:
|
|
126
|
+
### 3️⃣ Try it
|
|
128
127
|
|
|
129
128
|
```bash
|
|
130
129
|
# Npm
|
package/dist/index.mjs
CHANGED