{"id":25838,"library":"ko","title":"Ko","description":"Ko is a CLI tool for building and linting React applications. It uses webpack v5 and esbuild under the hood, providing a zero-config setup with customizable options. Version 6.6.7 is the latest stable release, with active development and a monthly release cadence. Key differentiators include built-in support for TypeScript, Sass/SCSS, Babel, and popular linting tools, as well as integration with the DTStack ecosystem. It is designed to simplify the build process for React projects, similar to Create React App but with more flexibility for advanced configurations.","status":"active","version":"6.6.7","language":"javascript","source_language":"en","source_url":"https://github.com/DTStack/ko","tags":["javascript","ko","react","typescript","babel","sass","scss","webpack","webpack v5"],"install":[{"cmd":"npm install ko","lang":"bash","label":"npm"},{"cmd":"yarn add ko","lang":"bash","label":"yarn"},{"cmd":"pnpm add ko","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundler used for production builds","package":"webpack","optional":false},{"reason":"Used for dev builds and fast compilation","package":"esbuild","optional":true}],"imports":[{"note":"Default import is used for the CLI entry point; for programmatic usage, ko may export an object with builder/linter functions.","wrong":"const ko = require('ko')","symbol":"ko","correct":"import ko from 'ko'"},{"note":"Named export for build function available since v6.0.","wrong":"import build from 'ko'","symbol":"build","correct":"import { build } from 'ko'"},{"note":"Correct named export is 'lint', not 'koLint'.","wrong":"import { koLint } from 'ko'","symbol":"lint","correct":"import { lint } from 'ko'"},{"note":"TypeScript type export; use import type to avoid runtime errors.","wrong":"import { Config } from 'ko'","symbol":"type CheckConfig","correct":"import type { Config } from 'ko'"}],"quickstart":{"code":"// Initialize a new ko project\nnpx ko init my-app\ncd my-app\n\n// Start development server\nnpx ko dev\n\n// Build for production\nnpx ko build\n\n// Lint source code\nnpx ko lint\n","lang":"typescript","description":"Shows how to create a new project with ko, start dev server, build for production, and run linting."},"warnings":[{"fix":"Update webpack to v5 or use ko v5.x.","message":"ko v6.0.0 drops support for webpack v4; projects using webpack v4 must upgrade.","severity":"breaking","affected_versions":">=6.0.0 <6.0.0"},{"fix":"Replace `ko analyze` with `ko build --analyze`.","message":"ko v6.3.0 deprecates 'analyze' command in favor of 'build --analyze'.","severity":"deprecated","affected_versions":">=6.3.0"},{"fix":"Disable esbuild in ko.config.js by setting 'builder: \"webpack\"'.","message":"ko uses esbuild for dev server; certain webpack loaders may not work with esbuild and will cause silent failures.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Use `import type { ... }` for type-only imports.","message":"ko enforces 'import type' for TypeScript type imports; using regular import may result in runtime errors in production builds.","severity":"gotcha","affected_versions":">=6.5.0"},{"fix":"Set Node engine or configure Babel targets in ko.config.js.","message":"ko's default Babel config includes @babel/preset-env which may cause issues with older Node versions.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Run `npx ko clean` to clear cache.","message":"ko caches build artifacts in .ko-cache; clearing this cache can resolve unexpected build errors.","severity":"gotcha","affected_versions":">=6.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 ko --save-dev`.","cause":"ko is not installed or not in node_modules.","error":"ModuleNotFoundError: Module not found: Error: Can't resolve 'ko'"},{"fix":"Ensure ko.config.js exports a valid configuration object: module.exports = { ... }.","cause":"Syntax error or missing export in config file.","error":"Error: ko.config.js is not a valid configuration file"},{"fix":"Use `import { build } from 'ko'` or `import ko from 'ko'` and access ko.build.","cause":"Importing from ko incorrectly.","error":"TypeError: Cannot read property 'build' of undefined"},{"fix":"Run `npm install @babel/core @babel/preset-env --save-dev`.","cause":"Missing Babel dependency.","error":"Error: [BABEL] Cannot find module '@babel/core'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}