feat(tooling): use vite-config tooling pkg

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-22 20:20:11 +01:00
committed by Braks
parent 7b590bd526
commit 2aa185756b
27 changed files with 662 additions and 1082 deletions
+2 -36
View File
@@ -1,47 +1,13 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueTypes from 'vite-plugin-vue-type-imports'
import AutoImport from 'unplugin-auto-import/vite'
import { withConfig } from '@vue-flow/vite-config'
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'~': resolve('src'),
},
dedupe: ['vue'],
extensions: ['.ts', '.vue'],
},
export default withConfig({
build: {
emptyOutDir: false,
lib: {
formats: ['es', 'cjs', 'iife'],
entry: resolve(__dirname, 'src/index.ts'),
fileName: 'vue-flow-pathfinding-edge',
name: 'vueFlowPathfindingEdge',
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['vue', '@vue-flow/core'],
output: {
dir: './dist',
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
'vue': 'Vue',
'@vue-flow/core': 'VueFlow',
},
},
},
},
plugins: [
vue(),
vueTypes(),
AutoImport({
imports: ['vue'],
dts: 'src/auto-imports.d.ts',
}),
],
})