Skip to content

Commit

Permalink
updated vite config for slightly easier use in dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
bbonf committed Jan 5, 2024
1 parent 2d9f63c commit 5aab8e1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion babex-vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,34 @@ import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {exec} from 'child_process'

// https://vitejs.dev/config/
export default defineConfig({
base: '/static/',
build: {
outDir: "../lab/main/static/vue",
outDir: 'dist',
manifest: true,
rollupOptions: {
input: 'src/main.ts'
}
},
plugins: [
vue(),

// a custom plugin that copies the built app into the static folder of both
// the lab and parent apps
{
name: 'duplicate-output',
closeBundle: async () => {
exec("bash -c 'cp -R dist ../lab/main/static/vue && cp -R dist ../parent/parent/static/vue'",
(error, stdout, stderr) => {
console.log(stdout);
console.log(stderr);
if (error) console.log('error:', error);
});
}
}
],
resolve: {
alias: {
Expand Down

0 comments on commit 5aab8e1

Please sign in to comment.