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,
        },
      ],
    }),
  ],
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    7,512
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    7,512
  • 0.1.0
    0

Package Sidebar

Install

npm i vite-plugin-replace

Homepage

leanupjs.org

Weekly Downloads

7,512

Version

0.1.1

License

MIT

Unpacked Size

6.19 kB

Total Files

6

Last publish

Collaborators

  • m.oppitz