chore: add internal vite config (#568)

This commit is contained in:
Marco Pasqualetti
2025-02-16 15:39:25 +01:00
committed by GitHub
parent d37b655add
commit 12e0937174
20 changed files with 420 additions and 1195 deletions
+7 -13
View File
@@ -7,9 +7,9 @@
"dev": "vite build --watch",
"build": "vite build",
"lint": "eslint .",
"format": "prettier --write --ignore-unknown --ignore-path ../../.prettierignore .",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../.prettierignore .",
"types": "tsc --noEmit",
"format": "prettier --check --ignore-unknown --ignore-path ../../.prettierignore .",
"format:fix": "prettier --write --ignore-unknown --ignore-path ../../.prettierignore .",
"typecheck": "tsc --noEmit",
"test:watch": "vitest",
"test": "vitest run"
},
@@ -23,7 +23,7 @@
"license": "MIT",
"type": "module",
"types": "dist/esm/index.d.ts",
"main": "dist/cjs/index.cjs",
"main": "dist/esm/index.js",
"module": "dist/esm/index.js",
"files": [
"dist",
@@ -32,14 +32,8 @@
],
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"./package.json": "./package.json"
},
@@ -50,13 +44,13 @@
"react-intersection-observer": "^9.13.0"
},
"devDependencies": {
"@tanstack/config": "0.7.13",
"@testing-library/react": "16.2.0",
"@types/react": "19.0.8",
"@vitejs/plugin-react-swc": "3.7.2",
"happy-dom": "16.8.1",
"react": "19.0.0",
"vite": "5.4.14",
"vite-config": "workspace:*",
"vitest": "2.1.9"
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ export class Router {
basePath = '/'
routeTree?: RouteTree
isServer = typeof document === 'undefined'
isServer: boolean = typeof document === 'undefined'
routesById: Record<string, Route> = {}
+10 -13
View File
@@ -1,22 +1,19 @@
/// <reference types="vitest" />
/// <reference types="vite/client" />
import { defineConfig, mergeConfig } from 'vitest/config'
import { tanstackBuildConfig } from '@tanstack/config/build'
import { defineViteConfig } from 'vite-config'
import react from '@vitejs/plugin-react-swc'
const config = defineConfig({
plugins: [react()],
test: {
name: 'tuono-router',
environment: 'happy-dom',
globals: true,
},
})
export default mergeConfig(
config,
tanstackBuildConfig({
defineConfig({
plugins: [react()],
test: {
name: 'tuono-router',
environment: 'happy-dom',
globals: true,
},
}),
defineViteConfig({
entry: './src/index.ts',
srcDir: './src',
}),
)