Registry / devops / create-file-webpack

create-file-webpack

JSON →
library1.0.2jsnpmunverified

A simple Webpack plugin that creates a file with specified content at the end of the build process. Version 1.0.2 is the current stable release, with no active maintenance or updates since 2019. It differentiates from similar plugins (e.g., `write-file-webpack-plugin`) by its minimalism: only three options (`path`, `fileName`, `content`). Works with Webpack 4 and earlier; compatibility with Webpack 5 is untested and likely requires adjustments due to hook changes.

npm install create-file-webpack
INSTALL
IMPORT
SIG · CREATE-FILE-WEBPAC
C
create-file-webpack
devopsjavascriptv1.0.2
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.

CreateFileWebpack
✓ const CreateFileWebpack = require('create-file-webpack')
✗ import CreateFileWebpack from 'create-file-webpack'
Package is CJS-only; ESM import will fail unless using bundler that can handle CJS interop.
default
✓ const CreateFileWebpack = require('create-file-webpack')
✗ const { default: CreateFileWebpack } = require('create-file-webpack')
No default export; the entire module is the constructor.
CreateFileWebpack (TypeScript)
✓ import CreateFileWebpack = require('create-file-webpack')
✗ import CreateFileWebpack from 'create-file-webpack'
Use `import = require` for CJS in TypeScript or use `const CreateFileWebpack = require('create-file-webpack')` in JavaScript.

Creates a version.txt file in dist/ with content '1.0.0' after build.

const CreateFileWebpack = require('create-file-webpack'); // webpack.config.js module.exports = { entry: './src/index.js', output: { path: __dirname + '/dist', filename: 'bundle.js' }, plugins: [ new CreateFileWebpack({ path: './dist', fileName: 'version.txt', content: '1.0.0' }) ] };
Debug
Known issues
breakingWebpack 5 may not work due to hook changes.
fix
Use an alternative plugin or check for updates on GitHub. Consider using 'write-file-webpack-plugin' or custom code.
affects: >=5.0.0
gotchaPlugin does not create directories recursively; path must exist.
fix
Ensure the output directory exists or use 'mkdirp' before running Webpack.
affects: >=1.0.0
gotchaContent is always a string; no support for Buffer or streams.
fix
Convert non-string content to string before passing.
affects: >=1.0.0
deprecatedPlugin has not been updated since 2019; newer Webpack versions may break.
fix
Consider migrating to a maintained alternative.
affects: >=4.0.0
Errors
Common errors & fixes
Error: 'options.path' must be a string
path option missing or not a string
fix
Ensure path is a string, e.g., new CreateFileWebpack({ path: './dist', ... })
TypeError: Cannot read property 'afterCompile' of undefined
Incompatible with Webpack 5 (hook changed).
fix
Use Webpack 4 or patch the plugin.
Error: Cannot find module 'create-file-webpack'
Package not installed or require path incorrect.
fix
Run 'npm install create-file-webpack --save-dev' and verify node_modules.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
webpackrequiredPeer dependency - works as a Webpack plugin
Agent activity
7 hits · last 30 days
node
6
Resources
create-file-webpack — npm install create-file-webpack · libregistry