vite-plugin-diff-compiler
v1.0.1
Published
Register global imports on demand for Vite and Webpack
Downloads
6
Maintainers
Readme
Install
npm install vite-plugin-diff-compiler -D
Usage
// package.json
{
"scripts": {
"dev": "vite",
"build": "vite build",
"dev:h5": "vite -m h5",
"build:h5": "vite build -m h5"
}
}
// vite.config.js
import { defineConfig } from 'vite'
import DiffCompiler from 'vite-plugin-diff-compiler'
export default defineConfig({
plugins: [
DiffCompiler(),
],
})
// only run `pnpm dev:h5` or `pnpm build:h5` will compile the code below
// #diff-compiler-start: h5
console.log('h5')
// #diff-compiler-end: h5