Skip to content

Commit

Permalink
fix build step
Browse files Browse the repository at this point in the history
  • Loading branch information
YieldRay committed Jan 25, 2025
1 parent 27b5630 commit b25f624
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "soda-material",
"version": "0.0.29",
"version": "0.0.30",
"type": "module",
"types": "dist/index.d.ts",
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/composition/Skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import './Skeleton.scss'
export const Skeleton = forwardRef<
HTMLDivElement,
Partial<React.CSSProperties>
>(({ ...style }) => {
return <div className="sd-skeleton" style={style} />
>(({ ...style }, ref) => {
return <div ref={ref} className="sd-skeleton" style={style} />
})
9 changes: 7 additions & 2 deletions src/documentation/Theming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ This library uses the official material design css variables (`--md-sys-color-<t

```ts
// create theme
import { type Theme, themeFromHexString, themeFromImageOrFile } from "soda-material/dist/utils/theme"
import {
type Theme,
themeFromHexString,
themeFromImageOrFile,
} from 'soda-material/dist/utils/theme'
const theme: Theme = themeFromHexString('#6750a4')
const theme: Theme = await themeFromImageOrFile(/* accept HTMLImageElement or File object */)
const theme: Theme =
await themeFromImageOrFile(/* accept HTMLImageElement or File object */)

// apply theme
import { applyThemeForSoda } from 'soda-material/dist/utils/theme'
Expand Down
8 changes: 6 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export default defineConfig({
css: {
preprocessorOptions: {
scss: {
additionalData: fs.readFileSync('./src/style/index.scss'),
additionalData: fs.readFileSync(
'./src/style/index.scss',
'utf-8',
),
api: 'modern-compiler',
silenceDeprecations: ['mixed-decls', 'import'],
},
Expand All @@ -30,9 +33,10 @@ export default defineConfig({
formats: ['es'],
fileName: (_format, entryName) => `${entryName}.js`,
entry: inventory(),
cssFileName: 'style',
},
rollupOptions: {
external: ['react', 'react-dom'],
external: ['react', 'react-dom', 'react/jsx-runtime'],
output: {
banner: `"use client";`,
manualChunks(id, { getModuleInfo }) {
Expand Down

0 comments on commit b25f624

Please sign in to comment.