Skip to content

Commit

Permalink
Fixed bundle types generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
webblocksapp committed Apr 5, 2023
1 parent 04bcad6 commit 05568c2
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions packages/lib/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,42 @@ const external = [...Object.keys(peerDependencies), ...Object.keys(devDependenci

const entries = [
{
plugins: [dts({ include: 'src/adapters/yupSchema/index.ts' })],
lib: {
entry: 'src/index.ts',
entry: 'src/adapters/yupSchema/index.ts',
fileName: (format: string) => {
return `index.${format}.js`;
return `adapters/yupSchema/index.${format}.js`;
},
},
emptyOutDir: true,
},
{
plugins: [dts({ include: 'src/adapters/zodSchema/index.ts' })],
lib: {
entry: 'src/adapters/yupSchema/index.ts',
entry: 'src/adapters/zodSchema/index.ts',
fileName: (format: string) => {
return `adapters/yupSchema/index.${format}.js`;
return `adapters/zodSchema/index.${format}.js`;
},
},
emptyOutDir: false,
},
{
plugins: [dts({ include: 'src' })],
lib: {
entry: 'src/adapters/zodSchema/index.ts',
entry: 'src/index.ts',
fileName: (format: string) => {
return `adapters/zodSchema/index.${format}.js`;
return `index.${format}.js`;
},
},
emptyOutDir: false,
},
];

const bundle = async () => {
entries.forEach(
async (entry) =>
await build({
plugins: [dts(), solidPlugin(), tsconfigPaths()],
plugins: [...entry.plugins, solidPlugin(), tsconfigPaths()],
build: {
lib: {
...entry.lib,
Expand Down

0 comments on commit 05568c2

Please sign in to comment.