@hyper-fetch/core
Version:
Cache, Queue and Persist your requests no matter if you are online or offline!
46 lines (44 loc) • 1.4 kB
text/typescript
/// <reference types="vitest/config" />
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import tsconfigPaths from "vite-tsconfig-paths";
import path from "path";
import { getDtsCompilerOptionsForPackage } from "../../scripts/vite-dts-internal-paths";
import { getRollupExternalsFromPackageJson } from "../../scripts/vite-lib-externals-from-package";
export default defineConfig({
build: {
lib: {
entry: "src/index.ts",
formats: ["es"],
fileName: "index",
},
sourcemap: true,
minify: false,
rollupOptions: {
external: getRollupExternalsFromPackageJson(__dirname),
},
},
plugins: [
dts({
entryRoot: "src",
compilerOptions: getDtsCompilerOptionsForPackage(__dirname),
}),
tsconfigPaths(),
],
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./__tests__/vitest.setup.ts"],
include: ["__tests__/**/*.spec.{ts,tsx}", "src/**/*.spec.{ts,tsx}"],
coverage: {
provider: "v8",
include: ["src/**/*.{ts,tsx}"],
exclude: ["**/*.spec.*", "**/types.*", "**/constants.*", "**/index.ts"],
},
alias: {
"@hyper-fetch/core": path.resolve(__dirname, "./src/index.ts"),
"@hyper-fetch/sockets": path.resolve(__dirname, "../sockets/src/index.ts"),
"@hyper-fetch/testing": path.resolve(__dirname, "../testing/src/index.ts"),
},
},
});