Socket
Socket
Sign inDemoInstall

rollup-plugin-delete

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-delete

Delete files and folders using Rollup


Version published
Weekly downloads
75K
decreased by-22.52%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-delete

Delete files and folders using Rollup.

About

This plugin is useful when you want to clean dist or other folders and files before bundling. It's using del package inside, check it for pattern examples.

Installation

# yarn
yarn add rollup-plugin-delete -D

# npm
npm install rollup-plugin-delete -D

Usage

// rollup.config.js
import del from 'rollup-plugin-delete'

export default {
  input: 'src/index.js',
  output: {
    file: 'dist/app.js',
    format: 'cjs'
  },
  plugins: [
    del({ targets: 'dist/*' })
  ]
}

Configuration

There are some useful options:

targets

A string or an array of patterns of files and folders to be deleted. Default is [].

del({
  targets: 'dist/*'
})

del({
  targets: ['dist/*', 'build/*']
})
verbose

Output removed files and folders to console. Default is false.

del({
  targets: 'dist/*',
  verbose: true
})

Note: use * (wildcard character) in pattern to show removed files

hook

Rollup hook the plugin should use. Default is buildStart.

del({
  targets: 'dist/*',
  hook: 'buildEnd'
})
runOnce

Type: boolean | Default: false

Delete items once. Useful in watch mode.

del({
  targets: 'dist/*',
  runOnce: true
})

All other options are passed to del package which is used inside.

License

MIT

Keywords

FAQs

Package last updated on 08 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc