Skip to content

Commit e26cbf2

Browse files
committed
replace react sdk native entry script
1 parent 789ed04 commit e26cbf2

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

packages/react-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"scripts": {
1313
"dev": "vite",
14-
"build": "tsc --project tsconfig.build.json && vite build && node scripts/create-native-entry.cjs",
14+
"build": "tsc --project tsconfig.build.json && vite build",
1515
"test": "vitest run",
1616
"test:watch": "vitest",
1717
"test:ci": "yarn test --reporter=default --reporter=junit --outputFile=junit.xml",
@@ -69,6 +69,7 @@
6969
"typescript": "^5.7.3",
7070
"vite": "^5.0.13",
7171
"vite-plugin-dts": "^4.0.0-beta.1",
72+
"vite-plugin-static-copy": "^1.0.6",
7273
"vitest": "^2.0.4",
7374
"webpack": "^5.89.0",
7475
"webpack-cli": "^5.1.4"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict";
2+
3+
module.exports = require("./reflag-react-sdk.umd.js");

packages/react-sdk/vite.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { resolve } from "path";
22
import preserveDirectives from "rollup-preserve-directives";
33
import { defineConfig } from "vite";
44
import dts from "vite-plugin-dts";
5+
import { viteStaticCopy } from "vite-plugin-static-copy";
56

67
export default defineConfig({
78
test: {
@@ -14,6 +15,14 @@ export default defineConfig({
1415
plugins: [
1516
dts({ insertTypesEntry: true, exclude: ["dev"] }),
1617
preserveDirectives(),
18+
viteStaticCopy({
19+
targets: [
20+
{
21+
src: "src/index.native.js",
22+
dest: ".",
23+
},
24+
],
25+
}),
1726
],
1827
build: {
1928
exclude: ["**/node_modules/**", "test/e2e/**", "dev"],

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5004,6 +5004,7 @@ __metadata:
50045004
typescript: "npm:^5.7.3"
50055005
vite: "npm:^5.0.13"
50065006
vite-plugin-dts: "npm:^4.0.0-beta.1"
5007+
vite-plugin-static-copy: "npm:^1.0.6"
50075008
vitest: "npm:^2.0.4"
50085009
webpack: "npm:^5.89.0"
50095010
webpack-cli: "npm:^5.1.4"

0 commit comments

Comments
 (0)