Registry / devops / webpack-mild-compile

webpack-mild-compile

JSON →
library3.4.0jsnpmunverified

A workaround to prevent webpack from endlessly recompiling when files are created or modified during watch mode, particularly useful in combination with plugins that dynamically generate files (e.g., webpack-iconfont, webpack-spritesmith). Version 3.4.0 supports webpack 2/3/4/5. The package provides both a webpack plugin and a Node API to decouple file events and avoid repeated compilation cycles. It is a lightweight, focused solution for a common footgun in webpack development workflows.

npm install webpack-mild-compile
INSTALL
IMPORT
SIG · WEBPACK-MILD-COMPI
W
webpack-mild-compile
devopsjavascriptv3.4.0
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

Plugin
const { Plugin } = require('webpack-mild-compile');
const WebpackMildCompile = require('webpack-mild-compile'); new WebpackMildCompile();
Plugin is exported as a named export. Directly calling the module as a function without .Plugin is incorrect for the plugin usage.
default
const mildCompile = require('webpack-mild-compile'); mildCompile(compiler);
const mildCompile = require('webpack-mild-compile').default;
The module exports a function directly for Node API usage. There is no .default export.
Plugin
import { Plugin } from 'webpack-mild-compile';
ESM import works as expected. The package provides TypeScript types.

Shows how to use webpack-mild-compile as a webpack plugin or via Node API to avoid endless recompilation during watch mode.

// Webpack plugin usage (prevent endless recompilation) const { Plugin } = require('webpack-mild-compile'); // webpack.config.js module.exports = { // ... other config plugins: [ new Plugin() ] }; // Or Node API usage (with webpack and koa-webpack) const webpack = require('webpack'); const config = require('./webpack.config.js'); const compiler = webpack(config); require('webpack-mild-compile')(compiler); const app = new (require('koa'))(); const koaWebpack = require('koa-webpack'); app.use(koaWebpack({ compiler }));
Debug
Known issues
gotchaPlugin must be instantiated with `new Plugin()` — calling the module as a function for plugin usage does nothing.
fix
Use `new (require('webpack-mild-compile').Plugin)()` or import the named export.
affects: >=1.0.0
deprecatedNo known deprecations in current version.
breakingNo known breaking changes between versions.
Errors
Common errors & fixes
TypeError: webpackMildCompile is not a constructor
Trying to use the default export as a constructor for the plugin (e.g., `new require('webpack-mild-compile')()`).
fix
Use the named export `Plugin` instead: `new (require('webpack-mild-compile').Plugin)()`.
Cannot find module 'webpack-mild-compile'
Package not installed or not in node_modules.
fix
Run `npm install --save-dev webpack-mild-compile`.
Upgrade
Version history
3.4.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
webpack-mild-compile — npm install webpack-mild-compile · libregistry