wip avec résolution de conflits
This commit is contained in:
parent
63b2d2b256
commit
ef19ba2b72
208 changed files with 178625 additions and 192002 deletions
49
cfg/vite.config.ts
Executable file
49
cfg/vite.config.ts
Executable file
|
|
@ -0,0 +1,49 @@
|
|||
import type { PathsOutput } from "fdir";
|
||||
import { fdir } from "fdir";
|
||||
import process from "node:process";
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
|
||||
const SLUG_THEME = "haiku-atelier-2024";
|
||||
const SRC_TYPESCRIPT_PATHS: Promise<PathsOutput> = new fdir()
|
||||
.withBasePath()
|
||||
.filter((path, isDirectory) => !isDirectory && !path.endsWith("d.ts"))
|
||||
.withMaxDepth(0)
|
||||
.crawl(`web/app/themes/${SLUG_THEME}/src/scripts`)
|
||||
.withPromise();
|
||||
const PATHS = await SRC_TYPESCRIPT_PATHS;
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), "VITE");
|
||||
|
||||
return {
|
||||
base: "/",
|
||||
cacheDir: ".cache/vite",
|
||||
build: {
|
||||
assetsDir: ".",
|
||||
cssMinify: "lightningcss",
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
minify: env["VITE_MODE"] === "production",
|
||||
outDir: "./web/app/themes/haiku-atelier-2024/assets/js",
|
||||
reportCompressedSize: true,
|
||||
rollupOptions: {
|
||||
input: PATHS,
|
||||
output: {
|
||||
assetFileNames: "[hash].[extname]",
|
||||
chunkFileNames: "[hash].js",
|
||||
entryFileNames: "[name].js",
|
||||
minify: env["VITE_MODE"] === "production",
|
||||
},
|
||||
treeshake: true,
|
||||
},
|
||||
sourcemap: env["VITE_MODE"] === "development",
|
||||
target: "es2020",
|
||||
write: true,
|
||||
},
|
||||
css: {
|
||||
devSourcemap: true,
|
||||
transformer: "lightningcss",
|
||||
},
|
||||
mode: env["VITE_MODE"] ?? "production",
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue