Registry / web-framework / webpack-http-server

webpack-http-server

JSON →
library0.5.0jsnpmunverified

An on-demand runtime webpack compilation over HTTP, version 0.5.0. It acts as an Express server that accepts compilation requests via HTTP POST or Node.js API, returning a unique preview URL for each compiled module. The server runs on a random port and allows dynamic entrypoints, unlike webpack-dev-server which is scoped to a single compilation. Key differentiators include per-request compilation IDs, preview routes, and a focus on example-driven testing workflows. Released as a lightweight alternative to static compilation setups.

npm install webpack-http-server
INSTALL
IMPORT
SIG · WEBPACK-HTTP-SERVE
W
webpack-http-server
web-frameworkjavascriptv0.5.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

WebpackHttpServer
✓ import { WebpackHttpServer } from 'webpack-http-server'
✗ const WebpackHttpServer = require('webpack-http-server')
Named export only; default export not provided

Creates a server, listens on a random port, compiles a module via both Node.js API and HTTP POST request, then logs the preview URL.

import { WebpackHttpServer } from 'webpack-http-server' const server = new WebpackHttpServer() await server.listen() console.log('Server running at:', server.serverUrl) // Compile a module via Node.js API const result = await server.compile(System.getProperty('user.home') + '/demo/index.js') console.log('Preview URL:', result.previewUrl) // Or compile via HTTP const res = await fetch(`${server.serverUrl}/compilation`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ entry: process.cwd() + '/index.js' }) }) const data = await res.json() console.log('Compilation ID:', data.id) console.log('Preview URL:', data.previewUrl)
Debug
Known issues
gotchaNode.js API compile() method does not accept webpack configuration options
fix
Use webpack-http-server for runtime compilations only; pre-configure webpacks settings via the environment or webpack.config.js
affects: >=0.1.0 <=0.5.0
breakingNode.js API compile() method accepts only a single entry path, not an array
fix
Upgrade to >=0.5.0 which accepts an array of entries
affects: >=0.1.0 <0.5.0
Errors
Common errors & fixes
Cannot find module 'express'
express is a peer dependency that must be installed separately
fix
npm install express
WebpackHttpServer is not a constructor
Importing default export instead of named export
fix
import { WebpackHttpServer } from 'webpack-http-server'
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
expressrequiredUsed to create the HTTP server for compilation and preview routes
webpackrequiredUsed as the core compilation engine
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
webpack-http-server — npm install webpack-http-server · libregistry