Registry / web-framework / create-weapp-vite

create-weapp-vite

JSON →
library2.3.10jsnpmunverified

Official scaffolding tool for weapp-vite, a Vite-based build tool for WeChat Mini Programs. Current stable version 2.3.10. Actively maintained with weekly releases. Key differentiator: provides multiple templates (Wevu, TDesign, Tailwindcss, Vant) and a programmable API for CI/CD, automatically aligning weapp-vite and wevu versions. Requires Node.js ^20.19.0 || >=22.12.0.

npm install create-weapp-vite
INSTALL
IMPORT
SIG · CREATE-WEAPP-VITE
C
create-weapp-vite
web-frameworkjavascriptv2.3.10
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createProject
import { createProject } from 'create-weapp-vite'
const { createProject } = require('create-weapp-vite')
ESM-only; CommonJS require will fail.
TemplateName
import { TemplateName } from 'create-weapp-vite'
import TemplateName from 'create-weapp-vite'
TemplateName is a named export, not default.
default (createProject)
import { createProject } from 'create-weapp-vite'
import createProject from 'create-weapp-vite'
No default export; use named import.

Creates a new WeChat Mini Program project using the 'wevu' template via the programmatic API.

import { createProject, TemplateName } from 'create-weapp-vite' async function main() { await createProject('my-miniapp', TemplateName.wevu) console.log('Project created!') } main().catch(console.error)
create-weapp-vite --version
Debug
Known issues
breakingRequires Node.js version ^20.19.0 or >=22.12.0. Older Node.js versions will fail at runtime.
fix
Update Node.js to 20.19.0+ or 22.12.0+ using nvm or your package manager.
affects: >=2.3.0
gotchaThe package is ESM-only since v2. Using CommonJS require() throws a runtime error.
fix
Ensure your project uses ESM ("type": "module" in package.json) or use dynamic import() if needed.
affects: >=2.0.0
deprecatedThe default export createProject was removed in v2. Use named export createProject instead.
fix
Change `import createProject from 'create-weapp-vite'` to `import { createProject } from 'create-weapp-vite'`.
affects: >=2.0.0
gotchaTemplate names are case-sensitive. Using incorrect casing (e.g., 'Wevu' vs 'wevu') will throw an error.
fix
Use the TemplateName enum or exact lowercase string: 'default', 'wevu', 'wevu-tdesign', 'tailwindcss', 'tdesign', 'vant', 'plugin', 'lib'.
affects: >=1.0.0
gotchaWhen using the CLI non-interactively, the project name must be provided as the first positional argument; omitting it will default to interactive mode.
fix
Always supply a project name when using non-interactive mode, e.g., `pnpm create weapp-vite my-app wevu`.
affects: >=2.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/create-weapp-vite/index.mjs not supported.
Using require() on an ESM-only package with Node.js < 20.19.0 or in a CJS project.
fix
Upgrade Node.js to >=20.19.0 and change to ESM ("type": "module" in package.json) or use `await import('create-weapp-vite')`.
Template 'my-custom-template' not found. Available templates: default, wevu, wevu-tdesign, tailwindcss, tdesign, vant, plugin, lib
Specifying a template name that does not exist or is misspelled.
fix
Use one of the supported template names: default, wevu, wevu-tdesign, tailwindcss, tdesign, vant, plugin, lib.
The "path" argument must be of type string. Received undefined
Calling createProject() without a project name or with an undefined argument.
fix
Pass a non-empty string as the first argument to createProject(), e.g., createProject('my-app', TemplateName.default).
Cannot find package 'create-weapp-vite'
The package is not installed. When using pnpm create, it fetches the package on the fly, but if you try to import it directly without installing, it fails.
fix
Run `pnpm add create-weapp-vite` or `npm install create-weapp-vite` before importing.
Upgrade
Version history
2.3.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
create-weapp-vite — npm install create-weapp-vite · libregistry