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

0.1.1 • Public • Published

Vite Plugin Replace

With this plugin text in sourcecode could be replaced before bundling.

Installation

npm i -D vite-plugin-replace

Usage

import packageJson from "./package.json";
import { replaceCodePlugin } from "vite-plugin-replace";

module.exports = mergeConfig(config, {
  plugins: [
    replaceCodePlugin({
      replacements: [
        {
          from: "__CLI_NAME__",
          to: packageJson.name,
        },
        {
          from: /__CLI_VERSION__/g,
          to: packageJson.version,
        },
      ],
    }),
  ],
});

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-replace

Homepage

leanupjs.org

Weekly Downloads

15,379

Version

0.1.1

License

MIT

Unpacked Size

6.19 kB

Total Files

6

Last publish

Collaborators

  • m.oppitz