Registry / web-framework / koot-webpack

koot-webpack

JSON →
library0.15.15jsnpmunverified

A webpack configuration generator specifically tailored for Koot.js applications, providing optimized setups for React SSR, SPA, and electron projects. Latest version 0.15.15 (released Feb 2024) with frequent minor updates. Key differentiators: built-in support for Qiankun micro-frontends, automatic SSR/SPA mode detection, and electron main process hot-reload. Targeted at Koot.js ecosystem users, not a general webpack utility.

npm install koot-webpack
INSTALL
IMPORT
SIG · KOOT-WEBPACK
K
koot-webpack
web-frameworkjavascriptv0.15.15
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.

default
import kootWebpack from 'koot-webpack'
const kootWebpack = require('koot-webpack')
Package is ESM-only since v0.15; no CommonJS export available.
getConfig
import { getConfig } from 'koot-webpack'
const { getConfig } = require('koot-webpack')
Named export for generating webpack config; ESM-only.
startDevServer
import { startDevServer } from 'koot-webpack'
Starts the development server with HMR; ESM-only.

Generates a webpack configuration for a Koot.js SSR project and runs the build.

import { getConfig } from 'koot-webpack'; import webpack from 'webpack'; const config = getConfig({ mode: 'development', projectPath: process.cwd(), type: 'ssr', // or 'spa', 'electron' env: { KEY: process.env.KEY ?? '' } }); webpack(config, (err, stats) => { if (err) { console.error(err); return; } console.log(stats.toString({ colors: true })); });
Debug
Known issues
breakingESM-only since v0.15: CommonJS require() will fail with ERR_REQUIRE_ESM.
fix
Use import instead of require(). If necessary, use dynamic import() in CommonJS.
affects: >=0.15.0
breakingWebpack 5 required as peer dependency. Using Webpack 4 will cause compatibility errors.
fix
Upgrade to webpack@5 and remove any webpack 4 specific loaders.
affects: >=0.15.0
deprecatedOption `templateInject` deprecated in v0.15.12; use `htmlPlugin` instead.
fix
Replace `templateInject` with `htmlPlugin` in your config.
affects: >=0.15.12
gotchaWhen using with Electron, target 'electron-renderer' is no longer set since v0.15.16. Node.js APIs may be unavailable.
fix
Use contextBridge to expose needed Node APIs to renderer processes.
affects: >=0.15.16
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/koot-webpack/index.js from /path/to/project not supported.
Package is ESM-only and cannot be imported with require() in vanilla Node.js.
fix
Change require() to dynamic import() or set "type": "module" in package.json.
Module not found: Error: Can't resolve 'webpack'
Webpack is a peer dependency but not installed.
fix
Run `npm install webpack@5 --save-dev` to install it.
TypeError: getConfig is not a function
Incorrect import style; likely used require() when package is ESM-only.
fix
Use `import { getConfig } from 'koot-webpack'` instead of `const { getConfig } = require(...)`.
Upgrade
Version history
0.15.15latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
koot-webpack — npm install koot-webpack · libregistry