Skip to content

Commit 3531216

Browse files
committed
chore: init basic needs
1 parent 712d83b commit 3531216

32 files changed

+682
-54
lines changed
File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@examples/react-component-bundle-false",
3+
"private": true,
4+
"scripts": {
5+
"build": "rslib build"
6+
},
7+
"devDependencies": {
8+
"@rsbuild/plugin-react": "1.0.1-rc.4",
9+
"@rslib/core": "workspace:*",
10+
"@types/react": "^18.3.5",
11+
"react": "^18.3.1"
12+
},
13+
"peerDependencies": {
14+
"react": "*"
15+
}
16+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { pluginReact } from '@rsbuild/plugin-react';
2+
import { type LibConfig, defineConfig } from '@rslib/core';
3+
4+
const shared: LibConfig = {
5+
bundle: false,
6+
};
7+
8+
export default defineConfig({
9+
source: {
10+
entry: {
11+
index: ['./src/**', '!./src/env.d.ts'],
12+
},
13+
},
14+
lib: [
15+
{
16+
...shared,
17+
format: 'esm',
18+
output: {
19+
distPath: {
20+
root: './dist/esm',
21+
css: '.',
22+
cssAsync: '.',
23+
},
24+
},
25+
bundle: false,
26+
},
27+
// {
28+
// ...shared,
29+
// format: 'cjs',
30+
// output: {
31+
// distPath: {
32+
// root: './dist/cjs',
33+
// css: '.',
34+
// cssAsync: '.',
35+
// },
36+
// },
37+
// bundle: false,
38+
// },
39+
],
40+
// tools: {
41+
// bundlerChain(config, {CHAIN_ID}) {
42+
// const cssExtract = CHAIN_ID.PLUGIN.MINI_CSS_EXTRACT
43+
// config.plugins.delete(cssExtract)
44+
45+
// },
46+
// cssExtract: {
47+
// loaderOptions: {
48+
// rootDir: './src',
49+
// },
50+
// },
51+
// },
52+
plugins: [pluginReact()],
53+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.button {
2+
background: blue;
3+
}

examples/react-component/src/CounterButton.tsx renamed to examples/react-component-bundle-false/src/CounterButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import styles from './CounterButton.module.css';
12
interface CounterButtonProps {
23
onClick: () => void;
34
label: string;
@@ -7,7 +8,7 @@ export const CounterButton: React.FC<CounterButtonProps> = ({
78
onClick,
89
label,
910
}) => (
10-
<button type="button" onClick={onClick}>
11+
<button type="button" className={styles.button} onClick={onClick}>
1112
{label}
1213
</button>
1314
);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.module.css' {
2+
const classes: { [key: string]: string };
3+
export default classes;
4+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { CounterButton } from './CounterButton';
22
import { useCounter } from './useCounter';
3+
import './reset.css';
34

45
export const Counter: React.FC = () => {
56
const { count, increment, decrement } = useCounter();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.body {
2+
background: red;
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react-jsx",
4+
"strict": true
5+
},
6+
"include": ["src/**/*"]
7+
}

0 commit comments

Comments
 (0)