Skip to content

Commit 4c12b6f

Browse files
committed
feat: support "umd" format
1 parent 10941c1 commit 4c12b6f

File tree

52 files changed

+626
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+626
-45
lines changed

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"javascript": {
2828
"formatter": {
2929
"quoteStyle": "single"
30-
}
30+
},
31+
"jsxRuntime": "reactClassic"
3132
},
3233
"json": {
3334
"formatter": {

examples/react-component-bundle-false/rslib.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,12 @@ export default defineConfig({
3535
},
3636
},
3737
],
38-
plugins: [pluginReact(), pluginSass()],
38+
plugins: [
39+
pluginReact({
40+
swcReactOptions: {
41+
runtime: 'classic',
42+
},
43+
}),
44+
pluginSass(),
45+
],
3946
});

examples/react-component-bundle-false/src/components/CounterButton/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import React from 'react';
12
import styles from './index.module.scss';
3+
24
interface CounterButtonProps {
35
onClick: () => void;
46
label: string;

examples/react-component-bundle-false/src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import { CounterButton } from './components/CounterButton/index';
23
import { useCounter } from './useCounter';
34
import './index.scss';

examples/react-component-bundle-false/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"esModuleInterop": true,
88
"forceConsistentCasingInFileNames": true,
99
"isolatedModules": true,
10-
"jsx": "react-jsx",
10+
"jsx": "react",
1111
"lib": ["DOM", "ESNext"],
1212
"moduleResolution": "node",
1313
"resolveJsonModule": true,

examples/react-component-bundle/rslib.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,12 @@ export default defineConfig({
3333
},
3434
},
3535
],
36-
plugins: [pluginReact(), pluginSass()],
36+
plugins: [
37+
pluginReact({
38+
swcReactOptions: {
39+
runtime: 'classic',
40+
},
41+
}),
42+
pluginSass(),
43+
],
3744
});

examples/react-component-bundle/src/components/CounterButton/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import React from 'react';
12
import styles from './index.module.scss';
3+
24
interface CounterButtonProps {
35
onClick: () => void;
46
label: string;

examples/react-component-bundle/src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react';
12
import { CounterButton } from './components/CounterButton/index';
23
import { useCounter } from './useCounter';
34
import './index.scss';

examples/react-component-bundle/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"esModuleInterop": true,
88
"forceConsistentCasingInFileNames": true,
99
"isolatedModules": true,
10-
"jsx": "react-jsx",
10+
"jsx": "react",
1111
"lib": ["DOM", "ESNext"],
1212
"moduleResolution": "node",
1313
"resolveJsonModule": true,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @examples/react-component
2+
3+
This example demonstrates how to use Rslib to build a simple React component.

0 commit comments

Comments
 (0)