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 dev

Open 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 preview

check 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.

CommandPurpose
npm run devDevelopment server on port 3000
npm testTemplate regression tests
npm run buildProduction build with sourcemaps
npm run check:buildValidate an existing build
npm run formatFormat supported source files with Prettier; excludes HTML

Troubleshooting #

  • Check node --version against the requirements above.
  • For inconsistent installations, run npm ci; retain the committed lockfile.
  • If a port is occupied, use npm run dev -- --port 3001 or npm run preview -- --port 4174.
  • Missing required vendor files now fail the build. Reinstall with npm ci and check the package's distribution paths before changing the copy plugin.
  • See the modernization review for the remaining dependency advisory and improvement priorities.

Next Steps #