parcel-reporter-clean-dist

    1.0.4 • Public • Published

    CircleCI

    parcel-reporter-clean-dist

    Reporter to clean files inside dist folder for Parcel V2 (buildSuccess event)

    Install

    Using npm:

    npm install -D parcel-reporter-clean-dist

    Using yarn:

    yarn add -D parcel-reporter-clean-dist

    Using bower:

    bower install -D parcel-reporter-clean-dist

    Configuration

    First of all, add a new reporter in the Parcel config.

    .parcelrc

    {
      "extends": ["@parcel/config-default"],
      "reporters":  ["...", "parcel-reporter-clean-dist"] // "..." is needed to include all other pipelines
    }

    That's it! all files except those generated on the current build will be removed from the dist folder.

    If you need to apply specific rules for the cleanup process, then define a config in the package.json of the project.

    package.json

    // example to remove only some specific file
    {
      ...
      "cleanDistFiles": ["dist/file1.txt"]
    }
    
    // example to remove only files with specific ext
    {
      ...
      "cleanDistFiles": ["dist/**/*.js"]
    }
    
    // example to exclude from removal some specific file/folder
    {
      ...
      "cleanDistFiles": ["!dist/file1.txt", "!dist/embed"]
    }

    cleanDistFiles

    Type: String[]
    Default: ${dist folder of the current build}/**/*
    Glob or relative path from where we clean files (root path is the current working directory of the process)

    Requirements

    Contributing

    Any contribution is highly appreciated.

    Licensing

    The code in this project is licensed under MIT license.

    Install

    npm i parcel-reporter-clean-dist

    DownloadsWeekly Downloads

    1,530

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    69.8 kB

    Total Files

    43

    Last publish

    Collaborators

    • pickydude