1.0.0-beta.3 • Published 1 year ago
vite-file-cache-plugin v1.0.0-beta.3
Vite file cache plugin
- Applicable to single files with long compilation time and low change frequenc.
- Such as global sass and less file, or component.
- Support hmr do not restart.
Install
npm install vite-file-cache-plugin --save-dev
Usage
vite.config.ts
import fileCahcePlugin from 'vite-file-cache-plugin'
export default defineConfig({
plugins: [
vue(),
fileCahcePlugin({
matchFn: (id) => id.includes('/src/styles/index.less')
})
]
})
Options
function | description | callback parameter |
---|---|---|
matchFn | assess whether to cache file | (id?: string) id: vite module id |
1.0.0-beta.3
1 year ago
1.0.0-beta.2
1 year ago