Skip to content

Commit 55239a6

Browse files
committed
add ci/cd
1 parent 2a41466 commit 55239a6

5 files changed

Lines changed: 28 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Modern React component library built with TypeScript, SCSS modules, and Storyboo
55
## 🚀 Features
66

77
- **React 19** with full TypeScript support
8-
- **SCSS Modules** for scoped styling
8+
- **SCSS Modules** for scoped styling with automatic CSS injection
99
- **Storybook** for component development and documentation
1010
- **Vite** for fast builds and development
1111
- **ESLint** for code quality
@@ -23,7 +23,6 @@ npm install @u4aew/react-component-publishing-guide
2323

2424
```tsx
2525
import { Button } from '@u4aew/react-component-publishing-guide';
26-
import '@u4aew/react-component-publishing-guide/dist/style.css';
2726

2827
function App() {
2928
return (

package-lock.json

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"typescript": "~5.8.3",
7676
"typescript-eslint": "^8.35.1",
7777
"vite": "^7.0.4",
78+
"vite-plugin-css-injected-by-js": "^3.5.2",
7879
"vite-plugin-dts": "^4.3.0",
7980
"vitest": "^3.2.4"
8081
}

src/components/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const Button = ({
2323
}: ButtonProps) => {
2424
const modeClass = primary ? styles.primary : styles.secondary;
2525
const sizeClass = styles[size];
26-
26+
2727
return (
2828
<button
2929
type="button"

vite.config.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { defineConfig } from 'vite';
33
import react from '@vitejs/plugin-react';
44
import { resolve } from 'path';
5+
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
56

67
// https://vite.dev/config/
78
import path from 'node:path';
@@ -11,7 +12,10 @@ const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(file
1112

1213
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
1314
export default defineConfig({
14-
plugins: [react()],
15+
plugins: [
16+
react(),
17+
cssInjectedByJsPlugin()
18+
],
1519
css: {
1620
modules: {
1721
localsConvention: 'camelCaseOnly'
@@ -30,9 +34,14 @@ export default defineConfig({
3034
globals: {
3135
react: 'React',
3236
'react-dom': 'ReactDOM'
37+
},
38+
assetFileNames: (assetInfo) => {
39+
if (assetInfo.name === 'style.css') return 'style.css';
40+
return assetInfo.name;
3341
}
3442
}
35-
}
43+
},
44+
cssCodeSplit: false
3645
},
3746
test: {
3847
projects: [{

0 commit comments

Comments
 (0)