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

1.9.1 • Public • Published

vite-plugin-replace

Replace a string with another string in all code files. Primary needed for the entry-point index.html file.

Usage

// vite.config.ts
import replace from "@lpgroup/vite-plugin-replace";

const replaceArr = [
  { src: "http://localhost:8189/harper-0.0.1.umd.js", production: "/harper/harper-0.0.1.umd.js" },
];

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
  return {
    plugins: [
      // ...otherplugins
      replace(replaceArr, mode),
    ],
  };
});

Package Sidebar

Install

npm i @lpgroup/vite-plugin-replace

Weekly Downloads

31

Version

1.9.1

License

MIT

Unpacked Size

4.67 kB

Total Files

8

Last publish

Collaborators

  • arlukin
  • muscot