2023-12-07 10:40:42 +00:00
|
|
|
import { resolve } from "path"
|
|
|
|
import { defineConfig } from "vite"
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
build: {
|
|
|
|
outDir: "./dist",
|
|
|
|
emptyOutDir: true,
|
|
|
|
lib: {
|
|
|
|
entry: {
|
2024-04-19 15:38:46 +00:00
|
|
|
web: "./src/web/index.ts",
|
|
|
|
node: "./src/node/index.ts",
|
2023-12-07 10:40:42 +00:00
|
|
|
},
|
|
|
|
name: "js-sandbox",
|
|
|
|
formats: ["es", "cjs"],
|
|
|
|
},
|
|
|
|
rollupOptions: {
|
2024-04-19 15:38:46 +00:00
|
|
|
external: ["module"],
|
2023-12-07 10:40:42 +00:00
|
|
|
},
|
|
|
|
},
|
2024-04-19 15:38:46 +00:00
|
|
|
test: {
|
|
|
|
environment: "node",
|
|
|
|
setupFiles: ["./setupFiles.ts"],
|
|
|
|
},
|
2023-12-07 10:40:42 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"~": resolve(__dirname, "./src"),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|