rebuildjs 0.37.7 → 0.37.9
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/build/index.js +14 -4
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -19,7 +19,15 @@ import { context } from 'esbuild'
|
|
|
19
19
|
import { fdir } from 'fdir'
|
|
20
20
|
import { cp, link, mkdir, readFile, rm } from 'node:fs/promises'
|
|
21
21
|
import { basename, dirname, extname, join, relative, resolve } from 'node:path'
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
app_path_,
|
|
24
|
+
browser_path_,
|
|
25
|
+
cwd_,
|
|
26
|
+
dist_path_,
|
|
27
|
+
is_prod_,
|
|
28
|
+
server__relative_path_,
|
|
29
|
+
server_path_
|
|
30
|
+
} from '../app/index.js'
|
|
23
31
|
import {
|
|
24
32
|
browser__metafile_,
|
|
25
33
|
browser__metafile__persist,
|
|
@@ -162,13 +170,13 @@ export async function browser__build(config) {
|
|
|
162
170
|
for (const path of path_a) {
|
|
163
171
|
entryPoints.push(path)
|
|
164
172
|
}
|
|
165
|
-
const
|
|
173
|
+
const external = [dist_path_(app_ctx) + '/*', ...(esbuild__config.external ?? [])]
|
|
174
|
+
const plugins = [rebuildjs_plugin_(), ...(esbuild__config.plugins ?? [])]
|
|
166
175
|
/** @type {import('esbuild').BuildOptions} */
|
|
167
176
|
const esbuild_config = {
|
|
168
177
|
entryNames: '[name]-[hash]',
|
|
169
178
|
assetNames: '[name]-[hash]',
|
|
170
179
|
bundle: true,
|
|
171
|
-
external: [],
|
|
172
180
|
target: 'es2021',
|
|
173
181
|
treeShaking: true,
|
|
174
182
|
minify: is_prod_(app_ctx),
|
|
@@ -180,6 +188,7 @@ export async function browser__build(config) {
|
|
|
180
188
|
absWorkingDir: cwd_(app_ctx),
|
|
181
189
|
metafile: true,
|
|
182
190
|
outdir: browser_path_(app_ctx),
|
|
191
|
+
external,
|
|
183
192
|
plugins,
|
|
184
193
|
}
|
|
185
194
|
const esbuild_ctx = await context(esbuild_config)
|
|
@@ -211,6 +220,7 @@ export async function server__build(config) {
|
|
|
211
220
|
for (const path of path_a) {
|
|
212
221
|
entryPoints.push(path)
|
|
213
222
|
}
|
|
223
|
+
const external = [dist_path_(app_ctx) + '/*', ...server__external_(esbuild__config)]
|
|
214
224
|
const plugins = [rebuildjs_plugin_(), ...(esbuild__config.plugins || [])]
|
|
215
225
|
const esbuild_config = {
|
|
216
226
|
entryNames: '[name]-[hash]',
|
|
@@ -227,7 +237,7 @@ export async function server__build(config) {
|
|
|
227
237
|
absWorkingDir: cwd_(app_ctx),
|
|
228
238
|
metafile: true,
|
|
229
239
|
outdir: server_path_(app_ctx),
|
|
230
|
-
external
|
|
240
|
+
external,
|
|
231
241
|
plugins,
|
|
232
242
|
}
|
|
233
243
|
const esbuild_ctx = await context(esbuild_config)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rebuildjs",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.9",
|
|
4
4
|
"description": "Reactive esbuild...simple hackable alternative to vite for Multi Page Apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"reactive",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"./package.json": "./package.json"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"ctx-core": "^5.
|
|
56
|
+
"ctx-core": "^5.19.0",
|
|
57
57
|
"elysia": "^0.8.9",
|
|
58
58
|
"esbuild": "^0.19.11",
|
|
59
59
|
"fdir": "^6.1.1",
|