{"id":42335,"library":"xhs-mp-pack","title":"xhs mp pack","description":"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.","status":"active","version":"2.1.6","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","cli","typescript"],"install":[{"cmd":"npm install xhs-mp-pack","lang":"bash","label":"npm"},{"cmd":"yarn add xhs-mp-pack","lang":"bash","label":"yarn"},{"cmd":"pnpm add xhs-mp-pack","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v2","wrong":"const cli = require('xhs-mp-pack')","symbol":"cli","correct":"import { cli } from 'xhs-mp-pack'"},{"note":"Named export, ESM only","wrong":"const { build } = require('xhs-mp-pack')","symbol":"build","correct":"import { build } from 'xhs-mp-pack'"},{"note":"TypeScript-friendly, ESM only","wrong":"const { defineConfig } = require('xhs-mp-pack')","symbol":"defineConfig","correct":"import { defineConfig } from 'xhs-mp-pack'"}],"quickstart":{"code":"import { build } from 'xhs-mp-pack';\n\nawait build({\n  input: 'src/app.js',\n  output: 'dist',\n  minify: true\n});","lang":"typescript","description":"Demonstrates basic build invocation with input/output paths and minification enabled."},"warnings":[{"fix":"Use ES modules (import syntax) or convert to ESM.","message":"Since v2.0.0, ESM only; CommonJS require() will throw an error.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade Node.js to >=14.","message":"The package assumes Node.js >=14; using older versions may cause runtime errors.","severity":"gotcha","affected_versions":"*"},{"fix":"Replace `compile()` with `build()`.","message":"API `compile()` was removed in v2.0.0; use `build()` instead.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'browser':52 'bundl':17 'cli':10,71 'compil':11,26 'core':12 'css':34 'definit':29 'depend':69 'differenti':55 'ecosystem':65 'environ':53 'extern':68 'fallback':50 'fast':25 'includ':56 'integr':58 'javascript':32,70 'key':54 'mini':15,63 'mini-program':14,62 'minim':67 'modern':31 'modul':46 'mp':2,5 'nativ':44 'node.js':45 'offer':24 'optim':18 'pack':3,6 'platform':22 'preprocess':35 'private/internal':39 'program':16,64 'provid':48 'releas':36 'reli':42 'support':30 'tight':57 'tool':40 'typescript':28,72 'v2.1.6':7 'xhs':1,4 'xiaohongshu':21,60 '小红书':20","created_at":"2026-06-04T18:56:45.572341+00:00","updated_at":"2026-06-04T18:56:45.572341+00:00","problems":[{"fix":"Change to import syntax or set type: module in package.json.","cause":"Using CommonJS require() with an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Use correct named import syntax: import { build } from 'xhs-mp-pack'.","cause":"Incorrect import of a named export as default.","error":"TypeError: (0 , something) is not a function"},{"fix":"Run npm install xhs-mp-pack and ensure it's in node_modules.","cause":"Package not installed or misconfigured in Node.js module resolution.","error":"Could not resolve 'xhs-mp-pack'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"xhs-mp-pack","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}