Registry /
devops / add-charset-webpack-plugin
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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AddCharsetWebpackPlugin
✓ import AddCharsetWebpackPlugin from 'add-charset-webpack-plugin'
✗ const { AddCharsetWebpackPlugin } = require('add-charset-webpack-plugin')
The package exports a default class; named destructuring with require will fail.
AddCharsetWebpackPlugin
✓ const AddCharsetWebpackPlugin = require('add-charset-webpack-plugin')
✗ const AddCharsetWebpackPlugin = require('add-charset-webpack-plugin').default
CommonJS require returns the class directly, not a module with a default property.
AddCharsetWebpackPlugin
✓ import AddCharsetWebpackPlugin from 'add-charset-webpack-plugin'
✗ import { AddCharsetWebpackPlugin } from 'add-charset-webpack-plugin'
Named import is incorrect; the plugin is the default export.
Demonstrates configuring the plugin with CommonJS require, setting charset to utf-8.
// webpack.config.js or rspack.config.js
const AddCharsetWebpackPlugin = require('add-charset-webpack-plugin');
module.exports = {
plugins: [
new AddCharsetWebpackPlugin({
charset: 'utf-8'
})
]
};
Errors
Common errors & fixes
TypeError: AddCharsetWebpackPlugin is not a constructor
Using named import { AddCharsetWebpackPlugin } from 'add-charset-webpack-plugin'
fixChange to default import: import AddCharsetWebpackPlugin from 'add-charset-webpack-plugin'
Module not found: Error: Can't resolve 'add-charset-webpack-plugin'
Package not installed or typo in package name
fixRun: npm install add-charset-webpack-plugin
Audit
Dependencies
No dependency data recorded yet.