mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-18 10:56:26 +08:00
33 lines
786 B
TypeScript
33 lines
786 B
TypeScript
import { join } from "node:path"
|
|
import { defineConfig } from "vitest/config"
|
|
import unimport from "unimport/unplugin"
|
|
import { projectDir } from "./shared/dir"
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: "node",
|
|
include: ["server/**/*.test.ts", "shared/**/*.test.ts", "test/**/*.test.ts"],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@shared": join(projectDir, "shared"),
|
|
"#": join(projectDir, "server"),
|
|
},
|
|
},
|
|
plugins: [
|
|
// https://github.com/unjs/nitro/blob/v2/src/core/config/resolvers/imports.ts
|
|
unimport.vite({
|
|
imports: [],
|
|
presets: [
|
|
{
|
|
package: "h3",
|
|
ignore: [/^[A-Z]/, r => r === "use"],
|
|
},
|
|
],
|
|
dirs: ["server/utils", "shared"],
|
|
// dts: false,
|
|
}),
|
|
],
|
|
})
|