Skip to content

Commit

Permalink
Add vite.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremynelissen committed Jan 4, 2024
1 parent d9f6a22 commit 622fc10
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {resolve} from 'path';
import dts from 'vite-plugin-dts';
import tsconfigPaths from 'vite-tsconfig-paths';
import {defineConfig} from 'vitest/config';

export default defineConfig(({mode}) => {
return {
plugins: [
tsconfigPaths({
projects: [mode === 'production' ? 'tsconfig.prod.json' : 'tsconfig.json']
}),
dts({tsconfigPath: mode === 'production' ? 'tsconfig.prod.json' : 'tsconfig.json'})
],
build: {
lib: {
name: 'random-color-generator',
entry: resolve(__dirname, 'src/index.ts')
},
rollupOptions: {
external: ['d3-color'],
output: {
globals: {
'd3-color': 'hsl'
}
}
}
}
};
});

0 comments on commit 622fc10

Please sign in to comment.