Nexanexa
← Reference

Third parties and vendoring

Bootstrap, PrimeVue, Chart.js, or coexisting with a whole Vue/React/Angular app.

Third-party CSS: a plain <link>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">

Nexa never processes or understands that CSS, so no special step is needed.

JS with a global build (UMD): a plain <script>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

function renderChart() {
    new Chart(document.getElementById("grafico"), { type: "bar", data: {} });
}

Leaves a global variable — since a chunk copies the handler verbatim, you can use it directly in an onClick, nothing to declare in nexa.toml.

Pure ES modules: [imports]

# nexa.toml
[imports]
confetti = "https://esm.sh/canvas-confetti"

function celebrate() { confetti.default(); }

The same mechanism platform/ui use. The chunk detects name. in the handler and prepends the import.

Vendoring a real npm package

npm install marked
echo 'export { marked } from "marked";' > entry.js
npx esbuild entry.js --bundle --format=esm --outfile=marked.js
cp marked.js public/vendor/marked.js

# nexa.toml
[imports]
marked = "/vendor/marked.js"

When it has its own dependencies or ships as CommonJS: install it, write an entry.js, and esbuild --bundle --format=esm into a single file under public/vendor/.