2.6.3 • Published 4 years ago

rollup-plugin-fresh v2.6.3

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

npm NPM

rollup-plugin-fresh

Remove all files or targeted files from a chosen directory

Install

Using npm:

npm install rollup-plugin-fresh --save-dev

Usage

Used as a plugin Runs when the config is first evaluated

Does not run before rebundling(in watch mode)

import startFresh from 'rollup-plugin-fresh';

plugins: [
  startFresh({
    chosenDir: "./public/",
    deleteAll: false,
    noDeleteOptions: ["global.css", ".html", ".png"],
    quiet: true
  }),
],

Options

chosenDir: "./public/"

deleteAll: false

noDeleteOptions: ["global.css", ".html", ".png"]

quiet: true

chosenDir - Required

Type: String Default: ""

Relative path starts at the root of your project

You can check the logs if the directory or file(s) are not found

Full relative path is required Incorrect - "public" Correct - "./public/"

Other examples "./public/bundle/" "./src/some/other/directory/"

deleteAll

Type: Boolean Default: true

true Deletes all files in the chosen directory Skips noDeleteOptions

false Deletes all files except files that match the noDeleteOptions Requires noDeleteOptions Uses Array.prototype.includes() under the hood to match files (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)

noDeleteOptions

Type: Array[...String] Default: []

Required when javascript deleteAll: false Since it is using Array.prototype.includes(), you can target files in different ways

["global.css", ".html", ".png", "importantfile.js", "randomName", ".cjs.js"]

quiet

Type: Boolean Default: false

true Does not log 'File Removed' activity during removal process Error logs will still be active

false logs all activity

2.6.3

4 years ago

2.6.2

4 years ago

2.6.1

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago