File tree Expand file tree Collapse file tree 3 files changed +9
-18
lines changed Expand file tree Collapse file tree 3 files changed +9
-18
lines changed Original file line number Diff line number Diff line change 17
17
" package" ,
18
18
" library"
19
19
],
20
- "files" : [
21
- " dist"
22
- ],
20
+ "files" : [" dist" ],
23
21
"tshy" : {
24
- "exclude" : [
25
- " src/**/*.test.ts" ,
26
- " vendor"
27
- ],
28
- "dialects" : [
29
- " esm" ,
30
- " commonjs"
31
- ],
22
+ "exclude" : [" src/**/*.test.ts" , " vendor" ],
23
+ "dialects" : [" esm" , " commonjs" ],
32
24
"exports" : {
33
25
"./package.json" : " ./package.json" ,
34
26
"." : " ./src/index.ts"
46
38
"postpublish" : " npx jsr publish" ,
47
39
"example:basic" : " bun example/basic/server.ts" ,
48
40
"example:server" : " bun example/server/server.ts" ,
49
- "example:tests" : " bun example/run-tests/index.ts"
41
+ "example:tests" : " bun example/run-tests/index.ts" ,
42
+ "example:module" : " bun example/custom-module/index.ts"
50
43
},
51
44
"author" : {
52
45
"name" : " Sebastian Wessel" ,
Original file line number Diff line number Diff line change @@ -14,12 +14,10 @@ import type { RuntimeOptions } from './types/RuntimeOptions.js'
14
14
export const getModuleLoader = ( options : RuntimeOptions ) => {
15
15
//const __dirname = dirname(fileURLToPath(import.meta.url))
16
16
17
- const customVol = options ?. nodeModules ? Volume . fromNestedJSON ( options ?. nodeModules ) : { }
18
-
19
17
const modules : Record < string , any > = {
20
18
'/' : {
21
19
node_modules : {
22
- ...customVol ,
20
+ ...options ?. nodeModules ,
23
21
path : {
24
22
'index.js' : pathModule ,
25
23
} ,
Original file line number Diff line number Diff line change 1
- import type { DirectoryJSON } from 'memfs'
1
+ import type { NestedDirectoryJSON } from 'memfs'
2
2
3
3
export type RuntimeOptions = {
4
4
/**
@@ -10,12 +10,12 @@ export type RuntimeOptions = {
10
10
* Mount a virtual file system
11
11
* @link https://github.com/streamich/memfs
12
12
*/
13
- mountFs ?: DirectoryJSON
13
+ mountFs ?: NestedDirectoryJSON
14
14
/**
15
15
* Mount custom node_modules in a virtual file system
16
16
* @link https://github.com/streamich/memfs
17
17
*/
18
- nodeModules ?: DirectoryJSON
18
+ nodeModules ?: NestedDirectoryJSON
19
19
/**
20
20
* Enable file capabilities
21
21
* If enabled, the package node:fs becomes available
You can’t perform that action at this time.
0 commit comments