{"id":27544,"library":"webpack-permissions-plugin","title":"webpack-permissions-plugin","description":"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.","status":"maintenance","version":"1.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/GeKorm/webpack-permissions-plugin","tags":["javascript","webpack","plugin","permissions","node","chmod"],"install":[{"cmd":"npm install webpack-permissions-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-permissions-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-permissions-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: plugin hooks into webpack compilation","package":"webpack","optional":false}],"imports":[{"note":"The package exports a CommonJS default; ESM import may fail depending on bundler.","wrong":"import PermissionsOutputPlugin from 'webpack-permissions-plugin';","symbol":"PermissionsOutputPlugin","correct":"const PermissionsOutputPlugin = require('webpack-permissions-plugin');"},{"note":"No TypeScript typings are shipped; use @types/webpack or define your own.","wrong":"import * as PermissionsOutputPlugin from 'webpack-permissions-plugin';","symbol":"PermissionsOutputPlugin (in TypeScript)","correct":"const PermissionsOutputPlugin = require('webpack-permissions-plugin');"},{"note":"The package was last tested with webpack 4; webpack 5 may require an adjust hook.","wrong":"Use with webpack 5 without shim","symbol":"PermissionsOutputPlugin (Webpack 5)","correct":"// Not officially supported"}],"quickstart":{"code":"const path = require('path');\nconst PermissionsOutputPlugin = require('webpack-permissions-plugin');\n\nmodule.exports = {\n  plugins: [\n    new PermissionsOutputPlugin({\n      buildFolders: [\n        path.resolve(__dirname, 'dist')\n      ],\n      buildFiles: [\n        path.resolve(__dirname, 'dist/app.js')\n      ],\n      // defaults: fileMode: '755', dirMode: '644'\n    })\n  ]\n};","lang":"javascript","description":"Sets 755 permissions on files and 644 on directories under dist/ using webpack-permissions-plugin."},"warnings":[{"fix":"Ensure PermissionsOutputPlugin is the last plugin in the plugins array.","message":"Permissions may be overwritten by other plugins running after this one (e.g., CopyWebpackPlugin).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check directory existence manually if needed.","message":"In v1.0.6, missing directories no longer cause build failure. If you relied on the error to catch missing paths, update your logic.","severity":"breaking","affected_versions":">=1.0.6"},{"fix":"Consider switching to a more modern plugin or a webpack 5-compatible alternative.","message":"The package is no longer actively maintained; no webpack 5 support.","severity":"deprecated","affected_versions":">=1.0.10"},{"fix":"Apply this plugin as the last step.","message":"File permissions are applied after webpack's emit hook; any post-processing that changes file content may reset permissions.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Always use '755' (string) or 0o755 (number), not 755 (decimal).","message":"The 'mode' option accepts octal strings or octal numbers; using decimal numbers will produce incorrect permissions.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install -D webpack-permissions-plugin' and ensure correct require path.","cause":"Package not installed or typo in import.","error":"Error: Cannot find module 'webpack-permissions-plugin'"},{"fix":"Use 'const PermissionsOutputPlugin = require(\"webpack-permissions-plugin\")'.","cause":"Importing the module incorrectly (e.g., using ES import without default).","error":"TypeError: PermissionsOutputPlugin is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}