Registry / devops / xhs-mp-pack

xhs-mp-pack

JSON →
library2.1.6jsnpmunverified

xhs mp pack (v2.1.6) is a CLI compiler core for mini-program bundling, optimized for 小红书 (Xiaohongshu) platform. It offers fast compilation with TypeScript definitions, supporting modern JavaScript and CSS preprocessing. Released as a private/internal tool, it relies on native Node.js modules and provides no fallback for browser environments. Key differentiators include tight integration with Xiaohongshu's mini-program ecosystem and minimal external dependencies.

npm install xhs-mp-pack
INSTALL
IMPORT
SIG · XHS-MP-PACK
X
xhs-mp-pack
devopsjavascriptv2.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

cli
import { cli } from 'xhs-mp-pack'
const cli = require('xhs-mp-pack')
ESM-only since v2
build
import { build } from 'xhs-mp-pack'
const { build } = require('xhs-mp-pack')
Named export, ESM only
defineConfig
import { defineConfig } from 'xhs-mp-pack'
const { defineConfig } = require('xhs-mp-pack')
TypeScript-friendly, ESM only

Demonstrates basic build invocation with input/output paths and minification enabled.

import { build } from 'xhs-mp-pack'; await build({ input: 'src/app.js', output: 'dist', minify: true });
Debug
Known issues
breakingSince v2.0.0, ESM only; CommonJS require() will throw an error.
fix
Use ES modules (import syntax) or convert to ESM.
affects: >=2.0.0
gotchaThe package assumes Node.js >=14; using older versions may cause runtime errors.
fix
Upgrade Node.js to >=14.
affects: *
deprecatedAPI `compile()` was removed in v2.0.0; use `build()` instead.
fix
Replace `compile()` with `build()`.
affects: >=2.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() with an ESM-only package.
fix
Change to import syntax or set type: module in package.json.
TypeError: (0 , something) is not a function
Incorrect import of a named export as default.
fix
Use correct named import syntax: import { build } from 'xhs-mp-pack'.
Could not resolve 'xhs-mp-pack'
Package not installed or misconfigured in Node.js module resolution.
fix
Run npm install xhs-mp-pack and ensure it's in node_modules.
Upgrade
Version history
2.1.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Resources
xhs-mp-pack — npm install xhs-mp-pack · libregistry