Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
'@types/node',
'node',
// umd tests need to lock this version
'react-aliased',
'react-18',
'react-dom-18',
],
postUpdateOptions: ['pnpmDedupe'],
}
7 changes: 2 additions & 5 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
"ignoreUnknown": true
},
"formatter": {
"ignore": [
"**/.rslib/*",
"./tests/e2e/react-component/public/umd/index.js"
],
"ignore": ["**/.rslib/*", "./tests/e2e/react-component/public/umd/*"],
"indentStyle": "space"
},
"javascript": {
Expand All @@ -47,7 +44,7 @@
"enabled": true,
"ignore": [
"./tests/integration/**/*/src/*",
"./tests/e2e/react-component/public/umd/index.js"
"./tests/e2e/react-component/public/umd/*"
],
"rules": {
"recommended": true,
Expand Down
26 changes: 15 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions tests/e2e/react-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
"version": "1.0.0",
"private": true,
"scripts": {
"build:umd": "cd ../../../examples/react-component-umd && pnpm run build",
"dev:bundle": "../../node_modules/.bin/rsbuild dev --environment=bundle",
"dev:bundle-false": "../../node_modules/.bin/rsbuild dev --environment=bundleFalse",
"dev:umd": "pnpm umd:build && pnpm umd:copy && ../../node_modules/.bin/rsbuild dev --environment=umd",
"umd:build": "cd ../../../examples/react-component-umd && pnpm run build",
"umd:copy": "rm -rf ./public && mkdir -p ./public/umd && cp ../../../examples/react-component-umd/dist/umd/index.js ./public/umd/index.js"
"dev:umd": "pnpm build:umd && ../../node_modules/.bin/rsbuild dev --environment=umd"
},
"dependencies": {
"@examples/react-component-bundle": "workspace:*",
"@examples/react-component-bundle-false": "workspace:*",
"@examples/react-component-umd": "workspace:*"
"@examples/react-component-umd": "workspace:*",
"react-18": "npm:[email protected]",
"react-dom-18": "npm:[email protected]"
}
}
18 changes: 16 additions & 2 deletions tests/e2e/react-component/rsbuild.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ export default defineConfig({
{
tag: 'script',
attrs: {
src: 'https://unpkg.com/react@18/umd/react.development.js',
src: '/umd/react.development.js',
},
head: true,
append: true,
},
{
tag: 'script',
attrs: {
src: 'https://unpkg.com/react-dom@18/umd/react-dom.development.js',
src: '/umd/react-dom.development.js',
},
head: true,
append: true,
Expand All @@ -57,6 +57,20 @@ export default defineConfig({
'react-dom': 'window ReactDom',
'react-dom/client': 'window ReactDom',
},
copy: [
{
from: '../../../examples/react-component-umd/dist/umd/index.js',
to: 'umd/index.js',
},
{
from: 'node_modules/react-18/umd/react.development.js',
to: 'umd/react.development.js',
},
{
from: 'node_modules/react-dom-18/umd/react-dom.development.js',
to: 'umd/react-dom.development.js',
},
],
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/umd-globals/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ test('correct read globals from CommonJS', async () => {
});

const { fn } = require(entryFiles.umd);
expect(await fn('ok')).toBe('DEBUG:18.3.0/ok');
expect(await fn('ok')).toBe('DEBUG:18.3.1/ok');
});
2 changes: 1 addition & 1 deletion tests/integration/umd-globals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"devDependencies": {
"react": "^19.1.0",
"react-aliased": "npm:[email protected].0"
"react-18": "npm:[email protected].1"
},
"peerDependencies": {
"react": "^18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/umd-globals/rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig({
lib: [generateBundleUmdConfig()],
output: {
externals: {
react: 'react-aliased',
react: 'react-18',
},
},
source: {
Expand Down
Loading