一覧へ戻る
mnrendra/rollup-plugin-chmod(新しいタブで開きます)
主要言語: TypeScript
🍣 A Rollup plugin to change file permission modes.
- star 数
- 3
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2025/03/05
主要言語: TypeScript
🍣 A Rollup plugin to change file permission modes.
🍣 A Rollup plugin to change file permission modes.
npm i -D @mnrendra/rollup-plugin-chmod
For ES modules (rollup.config.mjs):
import chmod from '@mnrendra/rollup-plugin-chmod' export default { external: (id) => !/^[./]/.test(id), input: 'your_input_file.(js|cjs|mjs|ts|cts|mts)', output: { file: 'bin/your_output_file.js', format: 'cjs', sourcemap: true }, plugins: chmod({ mode: '755' // <-- Will change the 'bin/your_output_file.js' permission mode to '-rwxr-xr-x' }) }
For CommonJS (rollup.config.js):
const chmod = require('@mnrendra/rollup-plugin-chmod') module.exports = { external: (id) => !/^[./]/.test(id), input: 'your_input_file.(js|cjs|mjs|ts|cts|mts)', output: { file: 'bin/your_output_file.js', format: 'cjs', sourcemap: true }, plugins: chmod({ mode: '755' // <-- Will change the 'bin/your_output_file.js' permission mode to '-rwxr-xr-x' }) }
const chmod = require('@mnrendra/rollup-plugin-chmod') module.exports = [ { plugins: [ chmod({ /** * The three rightmost digits define permissions for the file **owner**, **group**, and **others**. * * - 7: read, write, and execute * - 6: read and write * - 5: read and execute * - 4: read only * - 3: write and execute * - 2: write only * - 1: execute only * - 0: no permission * * example, `"755"`, means: * - The owner may read, write, and execute the file. * - The group may read and execute the file. * - Others may read and execute the file. * * @see https://nodejs.org/api/fs.html#file-modes * */ mode: '755' }) ] } ]
The three rightmost digits define permissions for the file owner, group, and others.
type: Mode
default: '644'
import type { Mode, Options, Plugin } from '@mnrendra/rollup-plugin-chmod'