Skip to content

rollup plugin: Delete package directory (删除打包目录)

Notifications You must be signed in to change notification settings

a572251465/rollup-plugin-del

Repository files navigation

rollup-plugin-del

rollup plugin && You can delete packaged directories and customize deletion rules

install

$ npm install rollup-plugin-del -D
$ yarn add rollup-plugin-del -D
$ pnpm install rollup-plugin-del -D

options

  • dest
    • default is empty. when not specified. will use output dir/ file. Priority is dir > file
    • if then value exists. This value is preferred
    • It can be a fixed path or a matching path satisfying glob
    • example
      • path.resolve(__dirname, "./dist/**/*.js") OR
      • path.resolve(__dirname, "dist")

use

import del from 'rollup-plugin-del'
export default defineConfig({
  input: resolvePath('../src/index.ts'),
  plugins: [
    del(),
//  del({dest: path.resolve(__dirname, "dist/**/*.js")})
    ts(),
    babel({
      babelHelpers: 'bundled'
    }),
    nodeResolve(),
    commonjs(),
    terser()
  ],
  output: [
    {
      file: resolvePath('../dist/index.esm.js'),
      format: 'esm'
    }
  ]
})

About

rollup plugin: Delete package directory (删除打包目录)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages