feat(tooling): add vite config to tooling pkgs

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 2a6077ed9f
commit 8dd453634c
9 changed files with 193 additions and 67 deletions
+3 -6
View File
@@ -29,18 +29,15 @@
"test": "exit 0"
},
"peerDependencies": {
"@vue-flow/core": "^1.12.2",
"vue": "^3.2.37"
"@vue-flow/core": "^1.12.2"
},
"dependencies": {},
"devDependencies": {
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vue-flow/tsconfig": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"unplugin-auto-import": "^0.14.4",
"vite": "^4.1.3",
"vite-plugin-vue-type-imports": "^0.2.4",
"@vue-flow/vite-config": "workspace:*",
"vite": "^4.1.4",
"vue-tsc": "^1.1.5"
},
"publishConfig": {
+2 -34
View File
@@ -1,45 +1,13 @@
import { resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import vueTypes from 'vite-plugin-vue-type-imports'
import { withConfig } from '@vue-flow/vite-config'
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
extensions: ['.ts', '.vue'],
},
export default withConfig({
build: {
emptyOutDir: false,
lib: {
formats: ['es', 'cjs', 'iife'],
entry: resolve(__dirname, 'src/index.ts'),
fileName: 'vue-flow-background',
name: 'vueFlowBackground',
},
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({
reactivityTransform: true,
}),
vueTypes(),
AutoImport({
imports: ['vue', 'vue/macros'],
dts: 'src/auto-imports.d.ts',
}),
],
})
+1
View File
@@ -3,6 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"declarationDir": "./dist",
"resolveJsonModule": true,
"types": [
"vite/client",
"vue/macros",