vite-plugin-const
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

vite-plugin-const

A Vite plugin for compile-time execution of ESM modules.

downloads npm version MIT license

Installation

# NPM
$ npm install --save-dev vite-plugin-const
# Yarn
$ yarn add -D vite-plugin-const
# PNPM
$ pnpm add -D vite-plugin-const
# Bun
$ bun add -D vite-plugin-const

Usage

Depending on what framework you are using your configuration will look slightly different. If you are using a Webpack based framework you should instead look towards const-module-loader, which is the same functionality but for Vite based frameworks.

Vite

Most frameworks will use the regular vite.config.js file where you can register the plugin like:

import constPlugin from "vite-plugin-const";

export default defineConfig({
  plugins: [constPlugin()],
});

License

Distributed under the MIT License. See LICENSE for more information.

/vite-plugin-const/

    Package Sidebar

    Install

    npm i vite-plugin-const

    Weekly Downloads

    3

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    20.8 kB

    Total Files

    11

    Last publish

    Collaborators

    • zebp