rebuildjs 0.11.0 → 0.11.2
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/browser/index.js +11 -8
- package/build/index.js +2 -10
- package/package.json +1 -1
package/browser/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { readFile } from 'fs/promises'
|
|
|
5
5
|
import { join, relative } from 'path'
|
|
6
6
|
import { browser__relative_path_, browser_path_ } from '../app/index.js'
|
|
7
7
|
import { app_ctx__be_config, middleware_ctx__be_config } from '../ctx/index.js'
|
|
8
|
-
import {
|
|
8
|
+
import { server__output_ } from '../server/index.js'
|
|
9
9
|
export const [
|
|
10
10
|
browser__metafile_path$_,
|
|
11
11
|
browser__metafile_path_,
|
|
@@ -22,7 +22,7 @@ async (ctx, browser__metafile$)=>{
|
|
|
22
22
|
let metafile_path
|
|
23
23
|
if (
|
|
24
24
|
!browser__metafile$.lock
|
|
25
|
-
|
|
25
|
+
&& await file_exists_(metafile_path = browser__metafile_path_(ctx))
|
|
26
26
|
) {
|
|
27
27
|
browser__metafile$._ = JSON.parse(await readFile(metafile_path).then(buf=>buf.toString()))
|
|
28
28
|
}
|
|
@@ -32,14 +32,17 @@ export const [
|
|
|
32
32
|
browser__output__relative_path$_,
|
|
33
33
|
browser__output__relative_path_
|
|
34
34
|
] = be_memo_pair_(ctx=>
|
|
35
|
-
nullish__none_([browser__metafile_(ctx),
|
|
36
|
-
(browser__metafile,
|
|
35
|
+
nullish__none_([browser__metafile_(ctx), server__output_(ctx)],
|
|
36
|
+
(browser__metafile, server__output)=>{
|
|
37
37
|
const { outputs } = browser__metafile
|
|
38
|
-
for (const
|
|
38
|
+
for (const browser__output__relative_path in outputs) {
|
|
39
|
+
const browser__output = outputs[browser__output__relative_path]
|
|
39
40
|
if (
|
|
40
|
-
|
|
41
|
+
browser__output.entryPoint
|
|
42
|
+
&& browser__output.entryPoint ===
|
|
43
|
+
server__output.entryPoint.replace(/\.server\.(ts|js|tsx|jsx)/, '.browser.$1')
|
|
41
44
|
) {
|
|
42
|
-
return
|
|
45
|
+
return browser__output__relative_path
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
}),
|
|
@@ -50,5 +53,5 @@ export const [
|
|
|
50
53
|
] = be_memo_pair_(ctx=>
|
|
51
54
|
nullish__none_([browser__output__relative_path_(ctx), browser__relative_path_(ctx)],
|
|
52
55
|
(browser__output__relative_path, browser__relative_path)=>
|
|
53
|
-
relative(browser__relative_path, browser__output__relative_path)),
|
|
56
|
+
join('/', relative(browser__relative_path, browser__output__relative_path))),
|
|
54
57
|
{ ...middleware_ctx__be_config, id: 'browser__script' })
|
package/build/index.js
CHANGED
|
@@ -5,16 +5,8 @@ import { writeFile } from '@ctx-core/monorepo'
|
|
|
5
5
|
import { build, context } from 'esbuild'
|
|
6
6
|
import { fdir } from 'fdir'
|
|
7
7
|
import { link, mkdir, rm } from 'fs/promises'
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
app_path_,
|
|
11
|
-
browser_path_,
|
|
12
|
-
cwd_,
|
|
13
|
-
is_prod_,
|
|
14
|
-
public_path_,
|
|
15
|
-
server__relative_path_,
|
|
16
|
-
server_path_
|
|
17
|
-
} from '../app/index.js'
|
|
8
|
+
import { join, relative, resolve } from 'path'
|
|
9
|
+
import { app_path_, browser_path_, cwd_, is_prod_, server__relative_path_, server_path_ } from '../app/index.js'
|
|
18
10
|
import { browser__metafile__set } from '../browser/index.js'
|
|
19
11
|
import { app_ctx } from '../ctx/index.js'
|
|
20
12
|
import { server__metafile_, server__metafile__set } from '../server/index.js'
|