Vite plugin for Zalo Mini App
npm install zmp-vite-plugin``bash`
npm i -D zmp-vite-plugin
`typescript
import { defineConfig, splitVendorChunkPlugin } from "vite";
import react from "@vitejs/plugin-react";
import zaloMiniApp from "zmp-vite-plugin";
export default () => {
return defineConfig({
plugins: [
react(), // If you are using React
splitVendorChunkPlugin(), // If you want to split vendor chunk to reduce the size of the main bundle
zaloMiniApp(),
],
});
};
`
> The plugin will read the app-config.json by default. If you pass any options to the plugin, this file will be ignored.
If you don't have zmp-cli installed, you can install it by running:
`bash`
pnpm add -g zmp-cli
`json`
{
"scripts": {
"start": "vite dev",
"build": "tsc && vite build",
"deploy:dev": "zmp-cli deploy --existing",
"deploy:testing": "zmp-cli deploy --existing --testing"
}
}
- 🔥 pnpm start to start local development serverpnpm build
- 🚀 to build your projectpnpm deploy
- 🚢 to deploy the app in DEVELOPMENT modepnpm deploy:testing` to deploy the app in TESTING mode
- ⚡