zmp-vite-plugin
v1.1.6
Published
Vite plugin for Zalo Mini App
Readme
⚡ Vite plugin for Zalo Mini App
How to setup?
1. Install
npm i -D zmp-vite-plugin2. Update your vite.config.ts
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.jsonby default. If you pass any options to the plugin, this file will be ignored.
Run & Deploy
1. Install the latest zmp-cli
If you don't have zmp-cli installed, you can install it by running:
pnpm add -g zmp-cli2. Update your package.json
{
"scripts": {
"start": "vite dev",
"build": "tsc && vite build",
"deploy:dev": "zmp-cli deploy --existing",
"deploy:testing": "zmp-cli deploy --existing --testing"
}
}3. Run
- 🔥
pnpm startto start local development server - 🚀
pnpm buildto build your project - 🚢
pnpm deployto deploy the app in DEVELOPMENT mode - ⚡
pnpm deploy:testingto deploy the app in TESTING mode
