Skip to content

Wrapper around the Eik rollup plugin to make it slightly more ergonomic to use in Vite

License

Notifications You must be signed in to change notification settings

eik-lib/vite-plugin

Repository files navigation

@eik/vite-plugin

Vite plugin for build-time import mapping with Eik.

This is a small wrapper around the Rollup plugin to make it slightly more ergonomic to use in Vite.

Installation

npm install --save-dev vite @eik/vite-plugin

Usage

import eik from "@eik/vite-plugin";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [eik()],
  build: {
    rollupOptions: {
      output: {
        // Turn off the asset hashes. Stable file names
        // make it easier to use the Eik node client:
        // https://github.com/eik-lib/node-client
        // Publishinig a new version on Eik gives a
        // unique URL, no hash needed.
        assetFileNames: "[name].[ext]",
        entryFileNames: "[name].js",
        chunkFileNames: "[name].js",
      },
    },
  },
});

Options

The options you can give to eik() are the same as for the Rollup plugin. Refer to the Rollup plugin documentation to see what you can do.

About

Wrapper around the Eik rollup plugin to make it slightly more ergonomic to use in Vite

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •