1
0

feat: make repo an installable node package

This commit is contained in:
AlanSilvaaa
2026-06-03 18:59:08 -04:00
parent 6b195e88c0
commit 4badd0210c
10 changed files with 162 additions and 43 deletions

View File

@@ -1,18 +1,39 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import { defineConfig, type PluginOption } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
export default defineConfig(({ command }) => {
const plugins: PluginOption[] = [vue()]
if (command === 'serve') {
plugins.push(vueDevTools())
}
return {
plugins,
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
},
build: {
lib: {
entry: fileURLToPath(new URL('./src/index.ts', import.meta.url)),
name: 'RenderMathProblems',
fileName: 'render-mathproblems',
},
rollupOptions: {
external: ['vue'],
output: {
exports: 'named',
globals: {
vue: 'Vue',
},
},
},
},
}
})