1.0.0 • Published 4 years ago

webpack-plugin-chmod v1.0.0

Weekly downloads
112
License
MIT
Repository
github
Last release
4 years ago

Webpack Plugin chmod

Improved version of webpack-permissions-plugin using GLOB to identify files.

A webpack plugin to manage the permissions of output files and directories Tested with Webpack 2, 3 and 4

Install

  • Yarn: yarn add -D webpack-plugin-chmod
  • Npm: npm i -D webpack-plugin-chmod

Usage

paths (Array< String|Object>) The directories to chmod recursively globOptions (Object) Options to pass to GLOB chmod (Number|String defaulted to 755) Permissions to set to all paths

Simple: Files 755
const ChmodPlugin = require("webpack-plugin-chmod");

plugins.push(
  new ChmodPlugin({
    paths: [
      "./node_modules/.bin/**",
      "./node_modules/**/.bin/**",
      "./node_modules/**/bin/**",
      "./node_modules/**/vendor/**",
    ],
  })
);
Advanced: Per-path modes
const ChmodPlugin = require("webpack-plugin-chmod");

plugins.push(
  new ChmodPlugin({
    paths: [
      {
        path: "./node_modules/.bin/**",
        globOptions: {},
        chmod: 0o755,
      },
    ],
  })
);