{"id":25833,"library":"kmc","title":"KISSY Module Compiler (kmc)","description":"A Node.js-based module bundler for KISSY framework, supporting KISSY 1.2+. Current stable version 1.2.2 (last release). It provides config API similar to KISSY's browser-side config, supports mixed encoding (e.g., GBK output), automatic combo for KISSY 1.3, dependency analysis, and regex-based module name mapping. Alternatives include the official Java-based KISSY build tool and grunt-kmc. Release cadence is low; no updates since 2015.","status":"maintenance","version":"1.2.2","language":"javascript","source_language":"en","source_url":"git://github.com/daxingplay/ModuleCompiler","tags":["javascript","kissy","build","module","compiler"],"install":[{"cmd":"npm install kmc","lang":"bash","label":"npm"},{"cmd":"yarn add kmc","lang":"bash","label":"yarn"},{"cmd":"pnpm add kmc","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package only supports CommonJS require; no ES module or TypeScript type definitions available.","wrong":"import kmc from 'kmc';","symbol":"kmc","correct":"const kmc = require('kmc');"}],"quickstart":{"code":"const kmc = require('kmc');\n\nkmc.config({\n  packages: [{\n    name: 'myapp',\n    path: '/absolute/path/to/myapp',\n    charset: 'utf-8'\n  }]\n});\n\nkmc.build({\n  src: '/absolute/path/to/myapp/src/main.js',\n  dest: '/absolute/path/to/myapp/build/main.combine.js',\n  outputCharset: 'utf-8'\n});\n\nconsole.log('Build completed.');","lang":"javascript","description":"Shows basic configuration and build process for bundling a KISSY module using absolute paths."},"warnings":[{"fix":"Use path.resolve(__dirname, 'relative/path') to convert to absolute paths.","message":"All paths must be absolute; relative paths will cause unexpected behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a Node version manager (e.g., nvm) with Node 10 or lower, or consider alternative bundlers like Webpack.","message":"The package expects Node.js >=0.10.0 (pre-ES6). It may not work on modern Node versions without compatibility shims.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use kmc.clean() before calling kmc.config() with new settings.","message":"kmc.config() without arguments returns the current config; it does not reset the config. Call kmc.clean() first if you need to clear.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set suffix: '.combine' (including the dot).","message":"Suffix configuration in kmc.config does not include a dot; e.g., use '.combine' not 'combine'.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install kmc' and use 'const kmc = require('kmc');'","cause":"Package not installed or not required correctly.","error":"Cannot find module 'kmc'"},{"fix":"Use absolute paths for src and dest in kmc.build().","cause":"Source or destination path is incorrect or not absolute.","error":"Error: ENOENT: no such file or directory, open '...'"},{"fix":"Use 'const kmc = require('kmc');' and ensure version >=1.0.0.","cause":"Incorrect import method (e.g., ES import) or using an older version.","error":"TypeError: kmc.build is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}