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
+6 -8
View File
@@ -26,27 +26,25 @@
"test": "exit 0;",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix ."
},
"peerDependencies": {
"@vue-flow/core": "^1.12.2"
},
"dependencies": {
"pathfinding": "^0.4.18",
"perfect-arrows": "^0.3.7"
},
"devDependencies": {
"@types/pathfinding": "^0.0.6",
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vue-flow/tsconfig": "workspace:*",
"@types/pathfinding": "^0.0.6",
"@vue-flow/vite-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"ts-patch": "^2.1.0",
"typescript-transform-paths": "^3.4.6",
"unplugin-auto-import": "^0.14.4",
"vite": "^4.1.3",
"vite-plugin-vue-type-imports": "^0.2.4",
"vite": "^4.1.4",
"vue-tsc": "^1.1.5"
},
"peerDependencies": {
"@vue-flow/core": "^1.12.2",
"vue": "^3.2.25"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
+7
View File
@@ -4,6 +4,13 @@
// Generated by unplugin-auto-import
export {}
declare global {
const $$: typeof import('vue/macros')['$$']
const $: typeof import('vue/macros')['$']
const $computed: typeof import('vue/macros')['$computed']
const $customRef: typeof import('vue/macros')['$customRef']
const $ref: typeof import('vue/macros')['$ref']
const $shallowRef: typeof import('vue/macros')['$shallowRef']
const $toRef: typeof import('vue/macros')['$toRef']
const EffectScope: typeof import('vue')['EffectScope']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
+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',
}),
],
})