Skip to content

Commit b664dba

Browse files
committed
chore: update
1 parent c5f5de1 commit b664dba

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

tests/e2e/react-component/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6+
"build:umd": "cd ../../../examples/react-component-umd && pnpm run build",
67
"dev:bundle": "../../node_modules/.bin/rsbuild dev --environment=bundle",
78
"dev:bundle-false": "../../node_modules/.bin/rsbuild dev --environment=bundleFalse",
8-
"dev:umd": "pnpm umd:build && pnpm umd:copy && ../../node_modules/.bin/rsbuild dev --environment=umd",
9-
"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 && 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"
9+
"dev:umd": "pnpm build:umd && ../../node_modules/.bin/rsbuild dev --environment=umd"
1110
},
1211
"dependencies": {
1312
"@examples/react-component-bundle": "workspace:*",

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ export default defineConfig({
5757
'react-dom': 'window ReactDom',
5858
'react-dom/client': 'window ReactDom',
5959
},
60+
copy: [
61+
{
62+
from: '../../../examples/react-component-umd/dist/umd/index.js',
63+
to: 'umd/index.js',
64+
},
65+
{
66+
from: 'node_modules/react-18/umd/react.development.js',
67+
to: 'umd/react.development.js',
68+
},
69+
{
70+
from: 'node_modules/react-dom-18/umd/react-dom.development.js',
71+
to: 'umd/react-dom.development.js',
72+
},
73+
],
6074
},
6175
},
6276
},

tests/integration/umd-globals/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ test('correct read globals from CommonJS', async () => {
88
});
99

1010
const { fn } = require(entryFiles.umd);
11-
expect(await fn('ok')).toBe('DEBUG:18.3.0/ok');
11+
expect(await fn('ok')).toBe('DEBUG:18.3.1/ok');
1212
});

0 commit comments

Comments
 (0)