Files
Atomcms-edit/vite.config.js
T
root e6d92f27b3 Migrate JavaScript to TypeScript with full type safety
- Rename all .js/.jsx files to .ts/.tsx across resources/js and theme dirs
- Add TypeScript 6.0 with strict mode, tsconfig.json
- Add type definitions for Inertia page props, Alpine.js, Turbolinks
- Update vite.config.js entries to .ts/.tsx extensions
- Update all Blade @vite() calls to match new .ts/.tsx entry points
- Add TypeScript ESLint config (replacing unused Vue plugin)
- Add @types/react, @types/react-dom, @types/lodash
- Add typecheck script and integrate into check pipeline
- Full tsc --noEmit, ESLint, and production build pass cleanly
2026-06-18 17:00:00 +02:00

54 lines
1.1 KiB
JavaScript
Executable File

import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import react from "@vitejs/plugin-react";
import path from "path";
import tailwindcss from "@tailwindcss/postcss";
import autoprefixer from "autoprefixer";
export default defineConfig({
plugins: [
laravel({
input: [
"resources/css/global.css",
"resources/js/global.ts",
"resources/js/ssr.tsx",
"resources/themes/atom/css/app.css",
"resources/themes/atom/js/app.js",
"resources/themes/dusk/css/app.css",
"resources/themes/dusk/js/app.js",
],
}),
react(),
{
name: "blade",
handleHotUpdate({ file, server }) {
if (file.endsWith(".blade.php")) {
server.ws.send({
type: "full-reload",
path: "*",
});
}
},
},
],
resolve: {
alias: {
"@": "/resources/js",
},
},
css: {
postcss: {
plugins: [tailwindcss(), autoprefixer()],
},
transformer: "postcss",
minify: false,
},
build: {
cssMinify: "esbuild",
minify: "esbuild",
target: "esnext",
},
});