Skip to content

Convert project to npm/Vite build pipeline#4

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/convert-to-npm-and-vite
Draft

Convert project to npm/Vite build pipeline#4
Copilot wants to merge 2 commits intomainfrom
copilot/convert-to-npm-and-vite

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

Replace manually vendored libraries with a proper npm dependency tree and Vite build pipeline. Docker/nginx deployment is preserved for content negotiation support.

Build pipeline

  • Added package.json + vite.config.js; npm run dev for local dev, npm run build for production
  • npm dependencies: bootstrap, bootstrap-icons, leaflet, n3, proj4, betterknown
  • yasgui-graph-plugin (not on npm) stays in vendor/ and is resolved via a @vendor Vite alias in vite.config.js

Source restructure

  • src/main.js — Vite entry point; imports all npm CSS/JS + app modules
  • src/dereferencer.js, src/map-viewer.js, src/graph-viewer.js — converted to proper ES modules with npm imports
  • public/assets/ — static pass-through files (runtime config.js placeholder, prefixes.json, favicon)

Runtime config

window.CONFIG (instead of const CONFIG) is written by entrypoint.sh at container startup, ensuring it's accessible inside ES module scope:

// entrypoint.sh writes at startup:
window.CONFIG = { SPARQL_ENDPOINT: '...', ENTITY_NS: '...', BASE_URI: window.location.origin };

index.html loads config.js as a plain <script> before the Vite bundle so it's available synchronously.

Docker

Dockerfile updated to a multi-stage build: Node 20 Alpine builds via npm ci && npm run build, then dist/ is copied into the nginxinc/nginx-unprivileged:alpine runtime image — no Node.js in the final image.

Original prompt

This section details on the original issue you should resolve

<issue_title>Convert project to use npm, vite, packages.json</issue_title>
<issue_description>The actual deployment should still be docker based using nginx because of it's possibility to do content negotiation</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert project to use npm and vite with packages.json Convert project to npm/Vite build pipeline Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert project to use npm, vite, packages.json

2 participants