Skip to content

Commit 6bda94b

Browse files
committed
chore: use local vendor instead of unpkg for react umd outputs
1 parent 15abef2 commit 6bda94b

File tree

7 files changed

+25
-13
lines changed

7 files changed

+25
-13
lines changed

.github/renovate.json5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
'@types/node',
6969
'node',
7070
// umd tests need to lock this version
71-
'react-aliased',
71+
'react-18',
72+
'react-dom-18',
7273
],
7374
postUpdateOptions: ['pnpmDedupe'],
7475
}

biome.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
"ignoreUnknown": true
2222
},
2323
"formatter": {
24-
"ignore": [
25-
"**/.rslib/*",
26-
"./tests/e2e/react-component/public/umd/index.js"
27-
],
24+
"ignore": ["**/.rslib/*", "./tests/e2e/react-component/public/umd/*"],
2825
"indentStyle": "space"
2926
},
3027
"javascript": {
@@ -47,7 +44,7 @@
4744
"enabled": true,
4845
"ignore": [
4946
"./tests/integration/**/*/src/*",
50-
"./tests/e2e/react-component/public/umd/index.js"
47+
"./tests/e2e/react-component/public/umd/*"
5148
],
5249
"rules": {
5350
"recommended": true,

pnpm-lock.yaml

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/e2e/react-component/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
"dev:bundle-false": "../../node_modules/.bin/rsbuild dev --environment=bundleFalse",
88
"dev:umd": "pnpm umd:build && pnpm umd:copy && ../../node_modules/.bin/rsbuild dev --environment=umd",
99
"umd:build": "cd ../../../examples/react-component-umd && pnpm run build",
10-
"umd:copy": "rm -rf ./public && mkdir -p ./public/umd && cp ../../../examples/react-component-umd/dist/umd/index.js ./public/umd/index.js"
10+
"umd:copy": "rm -rf ./public && mkdir -p ./public/umd && cp ../../../examples/react-component-umd/dist/umd/index.js ./public/umd/index.js && cp node_modules/react-18/umd/react.development.js ./public/umd/react.development.js && cp node_modules/react-dom-18/umd/react-dom.development.js ./public/umd/react-dom.development.js"
1111
},
1212
"dependencies": {
1313
"@examples/react-component-bundle": "workspace:*",
1414
"@examples/react-component-bundle-false": "workspace:*",
15-
"@examples/react-component-umd": "workspace:*"
15+
"@examples/react-component-umd": "workspace:*",
16+
"react-18": "npm:[email protected]",
17+
"react-dom-18": "npm:[email protected]"
1618
}
1719
}

tests/e2e/react-component/rsbuild.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ export default defineConfig({
2323
{
2424
tag: 'script',
2525
attrs: {
26-
src: 'https://unpkg.com/react@18/umd/react.development.js',
26+
src: '/umd/react.development.js',
2727
},
2828
head: true,
2929
append: true,
3030
},
3131
{
3232
tag: 'script',
3333
attrs: {
34-
src: 'https://unpkg.com/react-dom@18/umd/react-dom.development.js',
34+
src: '/umd/react-dom.development.js',
3535
},
3636
head: true,
3737
append: true,

tests/integration/umd-globals/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"devDependencies": {
66
"react": "^19.1.0",
7-
"react-aliased": "npm:[email protected]"
7+
"react-18": "npm:[email protected]"
88
},
99
"peerDependencies": {
1010
"react": "^18.3.1"

tests/integration/umd-globals/rslib.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
lib: [generateBundleUmdConfig()],
66
output: {
77
externals: {
8-
react: 'react-aliased',
8+
react: 'react-18',
99
},
1010
},
1111
source: {

0 commit comments

Comments
 (0)