File tree Expand file tree Collapse file tree 4 files changed +42
-12
lines changed Expand file tree Collapse file tree 4 files changed +42
-12
lines changed Original file line number Diff line number Diff line change 3030 "default" : " ./dist/index.cjs" ,
3131 "types" : " ./dist/index.d.cts"
3232 }
33+ },
34+ "./node" : {
35+ "node" : {
36+ "import" : {
37+ "default" : " ./lib/node.js" ,
38+ "types" : " ./lib/node.d.ts"
39+ },
40+ "require" : {
41+ "default" : " ./dist/node.cjs" ,
42+ "types" : " ./dist/node.d.cts"
43+ }
44+ },
45+ "default" : null
3346 }
3447 },
3548 "files" : [
Original file line number Diff line number Diff line change @@ -10,6 +10,16 @@ export default (commandLineArgs) => {
1010 // Clears rollup CLI warning https://github.com/rollup/rollup/issues/2694
1111 delete commandLineArgs . sourceMap ;
1212
13+ const plugins = [
14+ resolve ( ) ,
15+ commonjs ( ) ,
16+ typescript ( {
17+ tsconfig : './tsconfig.json' ,
18+ outDir : 'dist' ,
19+ sourceMap
20+ } )
21+ ] ;
22+
1323 return [
1424 {
1525 input : 'src/index.ts' ,
@@ -19,22 +29,29 @@ export default (commandLineArgs) => {
1929 sourcemap : sourceMap ,
2030 exports : 'named'
2131 } ,
22- plugins : [
23- resolve ( ) ,
24- commonjs ( ) ,
25- typescript ( {
26- tsconfig : './tsconfig.json' ,
27- outDir : 'dist' ,
28- sourceMap
29- } )
30- ] ,
32+ plugins,
3133 external : [ '@powersync/common' , 'expo-file-system' , 'base64-arraybuffer' ]
3234 } ,
33- // This is required to avoid https://github.com/arethetypeswrong/arethetypeswrong.github.io/blob/main/docs/problems/FalseESM.md
35+ {
36+ input : 'src/node.ts' ,
37+ output : {
38+ format : 'cjs' ,
39+ file : 'dist/node.cjs' ,
40+ sourcemap : sourceMap ,
41+ exports : 'named'
42+ } ,
43+ plugins,
44+ external : [ '@powersync/common' , 'fs' , 'path' ]
45+ } ,
3446 {
3547 input : './lib/index.d.ts' ,
3648 output : [ { file : 'dist/index.d.cts' , format : 'cjs' } ] ,
3749 plugins : [ dts ( ) ]
50+ } ,
51+ {
52+ input : './lib/node.d.ts' ,
53+ output : [ { file : 'dist/node.d.cts' , format : 'cjs' } ] ,
54+ plugins : [ dts ( ) ]
3855 }
3956 ] ;
40- } ;
57+ } ;
Original file line number Diff line number Diff line change 11export * from './Schema.js' ;
22export * from './LocalStorageAdapter.js' ;
3- export * from './storageAdapters/NodeFileSystemAdapter.js' ;
43export * from './storageAdapters/IndexDBFileSystemAdapter.js' ;
54export * from './storageAdapters/ExpoFileSystemAdapter.js' ;
65export * from './RemoteStorageAdapter.js' ;
Original file line number Diff line number Diff line change 1+ export * from './storageAdapters/NodeFileSystemAdapter.js' ;
You can’t perform that action at this time.
0 commit comments