mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-04 22:54:15 +02:00
Run oxfmt across repo, add format script and docs
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,29 +1,28 @@
|
||||
// @ts-ignore
|
||||
import { tanstackRouter } from '@tanstack/router-plugin/vite';
|
||||
import babel from '@rolldown/plugin-babel';
|
||||
import react, { reactCompilerPreset } from '@vitejs/plugin-react';
|
||||
import { createRequire } from 'node:module';
|
||||
import path from 'node:path';
|
||||
import { defineConfig, normalizePath } from 'vite-plus';
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import svgr from 'vite-plugin-svgr';
|
||||
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
||||
import babel from "@rolldown/plugin-babel";
|
||||
import react, { reactCompilerPreset } from "@vitejs/plugin-react";
|
||||
import { createRequire } from "node:module";
|
||||
import path from "node:path";
|
||||
import { defineConfig, normalizePath } from "vite-plus";
|
||||
import { viteStaticCopy } from "vite-plugin-static-copy";
|
||||
import svgr from "vite-plugin-svgr";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const cMapsDir = normalizePath(
|
||||
path.join(path.dirname(require.resolve('pdfjs-dist/package.json')), 'cmaps'),
|
||||
path.join(path.dirname(require.resolve("pdfjs-dist/package.json")), "cmaps"),
|
||||
);
|
||||
const standardFontsDir = normalizePath(
|
||||
path.join(path.dirname(require.resolve('pdfjs-dist/package.json')), 'standard_fonts'),
|
||||
path.join(path.dirname(require.resolve("pdfjs-dist/package.json")), "standard_fonts"),
|
||||
);
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(
|
||||
{
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tanstackRouter({
|
||||
target: 'react',
|
||||
routesDirectory: './routes',
|
||||
generatedRouteTree: './routeTree.gen.ts',
|
||||
target: "react",
|
||||
routesDirectory: "./routes",
|
||||
generatedRouteTree: "./routeTree.gen.ts",
|
||||
autoCodeSplitting: true,
|
||||
}),
|
||||
svgr(),
|
||||
@@ -33,28 +32,28 @@ export default defineConfig(
|
||||
}),
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
{ src: cMapsDir, dest: '' },
|
||||
{ src: standardFontsDir, dest: '' },
|
||||
{ src: cMapsDir, dest: "" },
|
||||
{ src: standardFontsDir, dest: "" },
|
||||
],
|
||||
}),
|
||||
],
|
||||
build: {
|
||||
sourcemap: true,
|
||||
outDir: '../dist',
|
||||
outDir: "../dist",
|
||||
emptyOutDir: true,
|
||||
rolldownOptions: {
|
||||
output: {
|
||||
// Make chunk names readable
|
||||
chunkFileNames: 'assets/chunk-[name]-[hash].js',
|
||||
entryFileNames: 'assets/entry-[name]-[hash].js',
|
||||
assetFileNames: 'assets/asset-[name]-[hash][extname]',
|
||||
chunkFileNames: "assets/chunk-[name]-[hash].js",
|
||||
entryFileNames: "assets/entry-[name]-[hash].js",
|
||||
assetFileNames: "assets/asset-[name]-[hash][extname]",
|
||||
},
|
||||
},
|
||||
},
|
||||
clearScreen: false,
|
||||
server: {
|
||||
port: parseInt(process.env.YAAK_DEV_PORT ?? '1420', 10),
|
||||
port: parseInt(process.env.YAAK_DEV_PORT ?? "1420", 10),
|
||||
strictPort: true,
|
||||
},
|
||||
envPrefix: ['VITE_', 'TAURI_'],
|
||||
envPrefix: ["VITE_", "TAURI_"],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user