Skip to content

Commit 4a5bf6e

Browse files
committed
build working
1 parent 8918598 commit 4a5bf6e

File tree

5 files changed

+57
-18
lines changed

5 files changed

+57
-18
lines changed

native.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
export * from "./dist/native.js"

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,23 @@
9999
"browser": "dist/auto.global.js",
100100
"react-native": "dist/core/native/index.js",
101101
"types": "dist/index.d.ts",
102+
"typesVersions": {
103+
"*": {
104+
"native": [
105+
"./dist/native.d.ts"
106+
],
107+
".": [
108+
"./dist/auto.d.ts"
109+
]
110+
}
111+
},
102112
"files": [
103113
"dist",
104114
"package.json",
105115
"README.md",
106116
"LICENSE",
107-
"auto.d.ts"
117+
"auto.d.ts",
118+
"native.js"
108119
],
109120
"scripts": {
110121
"build": "NODE_ENV=production tsup",

react-scan-0.0.15.tgz

102 KB
Binary file not shown.

src/native.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./core/native/scan"

tsup.config.ts

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,60 @@
11
import { defineConfig } from 'tsup';
22

3-
export default defineConfig({
4-
entry: [
5-
'./src/index.ts',
6-
'./src/auto.ts',
7-
'./src/rsc-shim.ts',
8-
'./src/core/native/index.ts',
9-
],
3+
const commonConfig = {
104
outDir: './dist',
115
splitting: false,
126
sourcemap: false,
13-
format: ['cjs', 'esm', 'iife'],
14-
target: 'esnext',
15-
platform: 'browser',
7+
target: 'esnext' as const,
168
treeshake: true,
179
dts: true,
18-
minify: 'terser',
10+
minify: false,
1911
env: {
12+
// @ts-expect-error node types
2013
NODE_ENV: process.env.NODE_ENV ?? 'development',
2114
},
22-
external: ['react', 'react-dom', 'react-reconciler'],
2315
esbuildOptions: (options) => {
2416
options.external = [
2517
'react-native',
2618
'@shopify/react-native-skia',
2719
'react-native-reanimated',
2820
];
2921
},
30-
outExtension({ format }) {
31-
return {
32-
js: `.${format === 'esm' ? 'mjs' : 'js'}`,
33-
};
22+
};
23+
24+
export default defineConfig([
25+
// Web build
26+
{
27+
...commonConfig,
28+
entry: ['./src/index.ts', './src/auto.ts', './src/rsc-shim.ts'],
29+
format: ['cjs', 'esm', 'iife'],
30+
platform: 'browser',
31+
external: ['react', 'react-dom', 'react-reconciler'],
32+
33+
outExtension({ format }) {
34+
return {
35+
js: `.${format === 'esm' ? 'mjs' : 'js'}`,
36+
};
37+
},
38+
},
39+
40+
// Native build
41+
{
42+
...commonConfig,
43+
entry: ['./src/native.ts', './src/core/native/index.ts'],
44+
format: ['cjs'],
45+
platform: 'node',
46+
47+
external: [
48+
'react',
49+
'react-native',
50+
'@shopify/react-native-skia',
51+
'react-native-reanimated',
52+
],
53+
target: 'esnext',
54+
outExtension() {
55+
return {
56+
js: '.js',
57+
};
58+
},
3459
},
35-
});
60+
]);

0 commit comments

Comments
 (0)