Installation #
Requirements #
Use Node.js 20.19+ or 22.12+ and npm. Node.js 24 LTS is recommended; .nvmrc selects it for nvm users. Older Node.js 16 instructions do not apply to Vite 8.
Install and Develop #
cd Admindek-VanillaJS
npm ci
npm run build
npm run devOpen http://localhost:3000. For the upload demo, use http://localhost:3000/forms/form2_flu-uppy.html. The files in src/html/ are templates: opening them directly with file:// or a generic static server displays raw @@include() directives. Vite redirects /src/html/... and /dist/... URLs to their processed public routes. Vite processes HTML templates and reloads pages when HTML changes. The initial build supplies compiled styles and copied vendor assets. Rebuild after changing dependencies or assets served from dist/.
Edit templates in src/html/, shared layouts in src/html/layouts/, and behavior and styles in src/assets/. Do not edit generated dist/ files.
Validate and Preview #
npm run check
npm run previewcheck runs Node regression tests, builds production output, and verifies local assets and template processing. Preview serves dist/ at http://localhost:4173; rebuild to preview later source changes. npm start builds and starts preview in one command.
| Command | Purpose |
|---|---|
npm run dev | Development server on port 3000 |
npm test | Template regression tests |
npm run build | Production build with sourcemaps |
npm run check:build | Validate an existing build |
npm run format | Format supported source files with Prettier; excludes HTML |
Troubleshooting #
- Check
node --versionagainst the requirements above. - For inconsistent installations, run
npm ci; retain the committed lockfile. - If a port is occupied, use
npm run dev -- --port 3001ornpm run preview -- --port 4174. - Missing required vendor files now fail the build. Reinstall with
npm ciand check the package's distribution paths before changing the copy plugin. - See the modernization review for the remaining dependency advisory and improvement priorities.