Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

javascript.vite

import { javascript } from "https://garn.io/ts/v0.0.16/mod.ts"; 

const { vite } = javascript;

Plugin for vite projects. This will add to your Project:

  • a Package called build that will bundle your vite project,
  • an Executable called dev that will run your dev server,
  • an Executable called preview that will run a server to preview your production build.

This plugin requires a field node_modules of type Package to work. Usually that is created with garn.javascript.mkNpmProject.

Here's an example:

import * as garn from "https://garn.io/ts/v0.0.16/mod.ts";

export const frontend = garn.javascript
  .mkNpmProject({
    description: "An NPM project",
    src: ".",
    nodeVersion: "18",
  })
  .add(garn.javascript.vite);

After running garn run frontend.build you can then access your built frontend bundle in ./result.

const vite: Plugin<{
build: Package;
dev: Executable;
preview: Executable;
}
, {
node_modules: Package;
}
>
;