Skip to content

Commit

Permalink
fix: rebase issue
Browse files Browse the repository at this point in the history
  • Loading branch information
e-krebs committed Sep 22, 2024
1 parent 908a62c commit a4fdf6e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 24 deletions.
44 changes: 21 additions & 23 deletions .ladle/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import tailwindcss from 'tailwindcss';
import fs from 'fs';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';

function inlineSvg(...paths) {
return {
name: 'inline-svg',
transformIndexHtml: {
enforce: 'pre',
transform: (html) => {
if (!Array.isArray(paths) || paths.length <= 0) return html;

let newHtml = html;
paths.forEach((svg) => {
const extractedSvg = fs.readFileSync(svg, 'utf8');
newHtml = newHtml.replace('<body>', `<body>${extractedSvg}`);
});
return newHtml;
},
},
};
}

export default defineConfig({
server: { open: false },
plugins: [react(), dts({ rollupTypes: true })],
css: {
postcss: {
plugins: [tailwindcss],
},
},
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: '@e-krebs/react-library',
fileName: 'index',
},
rollupOptions: {
external: ['react', 'react-dom', 'tailwindcss'],
output: { globals: { react: 'React', 'react-dom': 'ReactDOM', tailwindcss: 'tailwindcss' } },
},
sourcemap: true,
emptyOutDir: true,
},
plugins: [inlineSvg('src/assets/icons.svg', '.ladle/assets/stories-icons.svg')],
});
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion pocstcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
}
}
}
28 changes: 28 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import tailwindcss from 'tailwindcss';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';

export default defineConfig({
server: { open: false },
plugins: [react(), dts({ rollupTypes: true })],
css: {
postcss: {
plugins: [tailwindcss],
},
},
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: '@e-krebs/react-library',
fileName: 'index',
},
rollupOptions: {
external: ['react', 'react-dom', 'tailwindcss'],
output: { globals: { react: 'React', 'react-dom': 'ReactDOM', tailwindcss: 'tailwindcss' } },
},
sourcemap: true,
emptyOutDir: true,
},
});

0 comments on commit a4fdf6e

Please sign in to comment.