| 1 | import { resolve } from 'path'; |
| 2 | import { defineConfig } from 'vite' |
| 3 | import { appendExtension } from '../../vite.config.ts'; |
| 4 | import { createPluginDts } from '../vite-plugin-dts.ts'; |
| 5 | |
| 6 | // Once Vite supports multiple entries for plugins, this build can |
| 7 | // be merged into the main vite.config.ts. |
| 8 | // See https://github.com/vitejs/vite/pull/10609 |
| 9 | |
| 10 | export default defineConfig({ |
| 11 | build: { |
| 12 | emptyOutDir: false, |
| 13 | lib: { |
| 14 | formats: ['es', 'umd'], |
| 15 | entry: { |
| 16 | 'plugin/highlight': resolve(__dirname, 'index.ts'), |
| 17 | }, |
| 18 | name: 'RevealHighlight', |
| 19 | fileName: appendExtension |
| 20 | } |
| 21 | }, |
| 22 | plugins: [createPluginDts('highlight')], |
| 23 | }) |
| 24 |