mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Add biome + rolldown + lightningcss build pipeline for JS/CSS bundling & minification
- package.json with biome, rolldown, lightningcss devDependencies
- biome.json: add CSS formatter support
- scripts/build-css.mjs: lightningcss resolves @import chain, bundles/minifies CSS
- scripts/build-js.mjs: rolldown per-entry JS bundling (no code splitting)
- scripts/build.mjs: orchestrator for both CSS + JS
- scripts/check-build.mjs: staleness checker for CI/deploy guard
- justfile: add build, build-css, build-js, build-install, build-check recipes
- justfile: deploy recipe now runs build before deploy-code
- head.php + form-page.php: use dist/base.min.css instead of style.css
- All controllers + FormBootstrap: reference dist/*.min.{css,js}
- admin footer: load admin.min.js for all admin pages
- repertoire: use public.min.js instead of individual app JS files
- Fix stray '}' syntax error in admin.css line 305
- .gitignore: add app/public/assets/dist/
This commit is contained in:
43
rolldown.config.mjs
Normal file
43
rolldown.config.mjs
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Rolldown configuration for XAMXAM JS bundling.
|
||||
*
|
||||
* Entry points:
|
||||
* - admin.js → all JS needed on admin pages
|
||||
* - public.js → all JS needed on public-facing pages
|
||||
* - form.js → all JS needed on admin form pages (add/edit)
|
||||
*
|
||||
* Vendor scripts (htmx, FilePond plugins, OverType) are NOT bundled —
|
||||
* they're already minified and served from vendor/.
|
||||
*
|
||||
* Output: app/public/assets/dist/[name].min.js
|
||||
*/
|
||||
|
||||
import { defineConfig } from "rolldown";
|
||||
import { resolve, dirname } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const root = __dirname;
|
||||
const jsDir = resolve(root, "app/public/assets/js/app");
|
||||
const distDir = resolve(root, "app/public/assets/dist");
|
||||
|
||||
export default defineConfig({
|
||||
input: {
|
||||
admin: resolve(jsDir, "admin-entry.js"),
|
||||
public: resolve(jsDir, "public-entry.js"),
|
||||
form: resolve(jsDir, "form-entry.js"),
|
||||
partage: resolve(jsDir, "partage-entry.js"),
|
||||
},
|
||||
output: {
|
||||
dir: distDir,
|
||||
format: "esm",
|
||||
entryFileNames: "[name].min.js",
|
||||
// Disable code splitting — each entry gets its own self-contained bundle.
|
||||
codeSplitting: false,
|
||||
// rolldown built-in minification
|
||||
minify: true,
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".js"],
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user