-
Notifications
You must be signed in to change notification settings - Fork 327
/
Copy pathtsup.config.ts
34 lines (31 loc) · 1015 Bytes
/
tsup.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import autoPropsPlugin from '@vue.ts/tsx-auto-props/esbuild';
import { defineConfig, type Options } from 'tsup';
import vuePlugin from 'unplugin-vue/esbuild';
import { name, version } from './package.json';
type EsbuildPlugin = NonNullable<Options['esbuildPlugins']>[number];
export default defineConfig(() => {
return {
clean: true,
entry: ['./src/index.ts', './src/internal.ts', './src/errors.ts'],
format: ['esm'],
bundle: true,
sourcemap: true,
minify: false,
dts: false,
esbuildPlugins: [
// Adds .vue files support
vuePlugin() as EsbuildPlugin,
// Automatically generates runtime props from TypeScript types/interfaces for all
// control and UI components, adding them to Vue components during build via
// Object.defineProperty
autoPropsPlugin({
include: ['**/*.ts'],
}) as EsbuildPlugin,
],
define: {
PACKAGE_NAME: `"${name}"`,
PACKAGE_VERSION: `"${version}"`,
},
external: ['vue'],
};
});