feat(death): I want to die...
This commit is contained in:
parent
33e893ec58
commit
a16852c1b9
34 changed files with 761 additions and 321 deletions
|
|
@ -2,12 +2,32 @@ import { defineConfig } from 'vite'
|
|||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
import nodeExternals from 'rollup-plugin-node-externals'
|
||||
import path from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
|
||||
function collectDeps(...pkgJsonPaths) {
|
||||
const allDeps = new Set();
|
||||
for (const pkgPath of pkgJsonPaths) {
|
||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
||||
for (const dep of Object.keys(pkg.dependencies || {})) {
|
||||
allDeps.add(dep);
|
||||
}
|
||||
for (const peer of Object.keys(pkg.peerDependencies || {})) {
|
||||
allDeps.add(peer);
|
||||
}
|
||||
}
|
||||
return Array.from(allDeps);
|
||||
}
|
||||
|
||||
const externals = collectDeps(
|
||||
'./package.json',
|
||||
'../@shared/package.json'
|
||||
);
|
||||
|
||||
|
||||
export default defineConfig({
|
||||
root: __dirname, // service root
|
||||
plugins: [tsconfigPaths(), nodeExternals()],
|
||||
build: {
|
||||
|
||||
ssr: true,
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
|
|
@ -17,9 +37,9 @@ export default defineConfig({
|
|||
fileName: () => 'index.js',
|
||||
},
|
||||
rollupOptions: {
|
||||
external: [],
|
||||
external: externals,
|
||||
},
|
||||
target: 'node24', // or whatever Node version you use
|
||||
target: 'node22', // or whatever Node version you use
|
||||
sourcemap: true,
|
||||
minify: false, // for easier debugging
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue