Skip to content

Commit 9268b9b

Browse files
committed
simplify browser sdk native entry
1 parent df9feef commit 9268b9b

8 files changed

Lines changed: 45 additions & 46 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"build": "lerna run build --stream",
1414
"test:ci": "lerna run test:ci --stream",
1515
"test": "lerna run test --stream",
16-
"typecheck:native": "lerna run typecheck:native --stream",
1716
"format": "lerna run format --stream",
1817
"prettier": "lerna run prettier --stream",
1918
"prettier:fix": "lerna run prettier -- --write",

packages/browser-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"scripts": {
1414
"dev": "vite",
15-
"build": "tsc --project tsconfig.build.json && vite build && node scripts/create-native-entry.cjs",
15+
"build": "tsc --project tsconfig.native.json && tsc --project tsconfig.build.json && vite build",
1616
"test": "vitest run",
1717
"test:watch": "vitest",
1818
"test:e2e": "yarn build && playwright test",
@@ -66,6 +66,7 @@
6666
"typescript": "^5.7.3",
6767
"vite": "^5.3.5",
6868
"vite-plugin-dts": "^4.0.0-beta.1",
69+
"vite-plugin-static-copy": "^1.0.6",
6970
"vitest": "^2.0.4"
7071
}
7172
}

packages/browser-sdk/scripts/create-native-entry.cjs

Lines changed: 0 additions & 14 deletions
This file was deleted.
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-browser-sdk.umd.js");

packages/browser-sdk/vite.config.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { resolve } from "path";
22
import { defineConfig } from "vite";
33
import dts from "vite-plugin-dts";
4+
import { viteStaticCopy } from "vite-plugin-static-copy";
45
import { defaultExclude } from "vitest/config";
56

67
export default defineConfig({
@@ -11,7 +12,17 @@ export default defineConfig({
1112
setupFiles: ["./vitest.setup.ts"],
1213
exclude: [...defaultExclude, "test/e2e/**"],
1314
},
14-
plugins: [dts({ insertTypesEntry: true })],
15+
plugins: [
16+
dts({ insertTypesEntry: true }),
17+
viteStaticCopy({
18+
targets: [
19+
{
20+
src: "src/index.native.js",
21+
dest: ".",
22+
},
23+
],
24+
}),
25+
],
1526
build: {
1627
exclude: ["**/node_modules/**", "test/e2e/**"],
1728
sourcemap: true,

packages/react-sdk/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"test:watch": "vitest",
1717
"test:ci": "yarn test --reporter=default --reporter=junit --outputFile=junit.xml",
1818
"coverage": "yarn test --coverage",
19-
"typecheck:native": "tsc --project tsconfig.native.json",
2019
"lint": "eslint .",
2120
"lint:ci": "eslint --output-file eslint-report.json --format json .",
2221
"prettier": "prettier --check .",

packages/react-sdk/tsconfig.native.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

yarn.lock

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4793,6 +4793,7 @@ __metadata:
47934793
typescript: "npm:^5.7.3"
47944794
vite: "npm:^5.3.5"
47954795
vite-plugin-dts: "npm:^4.0.0-beta.1"
4796+
vite-plugin-static-copy: "npm:^1.0.6"
47964797
vitest: "npm:^2.0.4"
47974798
languageName: unknown
47984799
linkType: soft
@@ -11977,6 +11978,19 @@ __metadata:
1197711978
languageName: node
1197811979
linkType: hard
1197911980

11981+
"fast-glob@npm:^3.2.11, fast-glob@npm:^3.3.2":
11982+
version: 3.3.3
11983+
resolution: "fast-glob@npm:3.3.3"
11984+
dependencies:
11985+
"@nodelib/fs.stat": "npm:^2.0.2"
11986+
"@nodelib/fs.walk": "npm:^1.2.3"
11987+
glob-parent: "npm:^5.1.2"
11988+
merge2: "npm:^1.3.0"
11989+
micromatch: "npm:^4.0.8"
11990+
checksum: 10c0/f6aaa141d0d3384cf73cbcdfc52f475ed293f6d5b65bfc5def368b09163a9f7e5ec2b3014d80f733c405f58e470ee0cc451c2937685045cddcdeaa24199c43fe
11991+
languageName: node
11992+
linkType: hard
11993+
1198011994
"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.1":
1198111995
version: 3.3.1
1198211996
resolution: "fast-glob@npm:3.3.1"
@@ -12003,19 +12017,6 @@ __metadata:
1200312017
languageName: node
1200412018
linkType: hard
1200512019

12006-
"fast-glob@npm:^3.3.2":
12007-
version: 3.3.3
12008-
resolution: "fast-glob@npm:3.3.3"
12009-
dependencies:
12010-
"@nodelib/fs.stat": "npm:^2.0.2"
12011-
"@nodelib/fs.walk": "npm:^1.2.3"
12012-
glob-parent: "npm:^5.1.2"
12013-
merge2: "npm:^1.3.0"
12014-
micromatch: "npm:^4.0.8"
12015-
checksum: 10c0/f6aaa141d0d3384cf73cbcdfc52f475ed293f6d5b65bfc5def368b09163a9f7e5ec2b3014d80f733c405f58e470ee0cc451c2937685045cddcdeaa24199c43fe
12016-
languageName: node
12017-
linkType: hard
12018-
1201912020
"fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0":
1202012021
version: 2.1.0
1202112022
resolution: "fast-json-stable-stringify@npm:2.1.0"
@@ -22770,6 +22771,20 @@ __metadata:
2277022771
languageName: node
2277122772
linkType: hard
2277222773

22774+
"vite-plugin-static-copy@npm:^1.0.6":
22775+
version: 1.0.6
22776+
resolution: "vite-plugin-static-copy@npm:1.0.6"
22777+
dependencies:
22778+
chokidar: "npm:^3.5.3"
22779+
fast-glob: "npm:^3.2.11"
22780+
fs-extra: "npm:^11.1.0"
22781+
picocolors: "npm:^1.0.0"
22782+
peerDependencies:
22783+
vite: ^5.0.0
22784+
checksum: 10c0/997114571bd429481974483465ab78d1ecd5fc48d2de06cbfe9dbf005f9b870aa072b0d9c22e2fd8def759db2c48ad662a6a0cdf47706fba409c82db7c03ed22
22785+
languageName: node
22786+
linkType: hard
22787+
2277322788
"vite@npm:^5.0.0 || ^6.0.0":
2277422789
version: 6.3.6
2277522790
resolution: "vite@npm:6.3.6"

0 commit comments

Comments
 (0)