@jswork/vite-plugin-file-callback
v1.0.9
Published
Vite plugin that allows users to customize file handling and modification through callback functions.
Downloads
10
Readme
vite-plugin-file-callback
Vite plugin that allows users to customize file handling and modification through callback functions.
installation
npm install @jswork/vite-plugin-file-callback
usage
import fileCallback from '@jswork/vite-plugin-file-callback';
// Get envs:
const env = ENV[process.env.NODE_ENV];
// Use plugin:
fileCallback({
filepath: 'src/manifest.json',
callback: (content) => {
nx.set(content, 'mp-weixin.appid', env['VITE_APP_APPID']);
return content;
}
})
license
Code released under the MIT license.