Registry / devops / webpack-permissions-plugin

webpack-permissions-plugin

JSON →
library1.0.10jsnpmunverified

A webpack plugin to set file and directory permissions (chmod) on output files and folders. Currently at version 1.0.10 (last updated 2022), with infrequent releases. Tested with Webpack 2, 3, and 4. Supports both simple string paths and per-path mode configurations using octal strings or integers. Unlike generic chmod scripts, it integrates directly into the webpack build pipeline. Minimal dependencies; notable for its simplicity but lacks support for webpack 5 and has limited maintenance.

npm install webpack-permissions-plugin
INSTALL
IMPORT
SIG · WEBPACK-PERMISSION
W
webpack-permissions-plugin
devopsjavascriptv1.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

PermissionsOutputPlugin
const PermissionsOutputPlugin = require('webpack-permissions-plugin');
import PermissionsOutputPlugin from 'webpack-permissions-plugin';
The package exports a CommonJS default; ESM import may fail depending on bundler.
PermissionsOutputPlugin (in TypeScript)
const PermissionsOutputPlugin = require('webpack-permissions-plugin');
import * as PermissionsOutputPlugin from 'webpack-permissions-plugin';
No TypeScript typings are shipped; use @types/webpack or define your own.
PermissionsOutputPlugin (Webpack 5)
// Not officially supported
Use with webpack 5 without shim
The package was last tested with webpack 4; webpack 5 may require an adjust hook.

Sets 755 permissions on files and 644 on directories under dist/ using webpack-permissions-plugin.

const path = require('path'); const PermissionsOutputPlugin = require('webpack-permissions-plugin'); module.exports = { plugins: [ new PermissionsOutputPlugin({ buildFolders: [ path.resolve(__dirname, 'dist') ], buildFiles: [ path.resolve(__dirname, 'dist/app.js') ], // defaults: fileMode: '755', dirMode: '644' }) ] };
Debug
Known issues
gotchaPermissions may be overwritten by other plugins running after this one (e.g., CopyWebpackPlugin).
fix
Ensure PermissionsOutputPlugin is the last plugin in the plugins array.
affects: >=0.0.0
breakingIn v1.0.6, missing directories no longer cause build failure. If you relied on the error to catch missing paths, update your logic.
fix
Check directory existence manually if needed.
affects: >=1.0.6
deprecatedThe package is no longer actively maintained; no webpack 5 support.
fix
Consider switching to a more modern plugin or a webpack 5-compatible alternative.
affects: >=1.0.10
gotchaFile permissions are applied after webpack's emit hook; any post-processing that changes file content may reset permissions.
fix
Apply this plugin as the last step.
affects: >=0.0.0
gotchaThe 'mode' option accepts octal strings or octal numbers; using decimal numbers will produce incorrect permissions.
fix
Always use '755' (string) or 0o755 (number), not 755 (decimal).
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'webpack-permissions-plugin'
Package not installed or typo in import.
fix
Run 'npm install -D webpack-permissions-plugin' and ensure correct require path.
TypeError: PermissionsOutputPlugin is not a constructor
Importing the module incorrectly (e.g., using ES import without default).
fix
Use 'const PermissionsOutputPlugin = require("webpack-permissions-plugin")'.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies
webpackrequiredpeer dependency: plugin hooks into webpack compilation
Agent activity
7 hits · last 30 days
node
6
Resources
webpack-permissions-plugin — npm install webpack-permissions-plugin · libregistry