npm.io
1.0.1 • Published 4 years ago

rollup-plugin-del

Licence
MIT
Version
1.0.1
Deps
2
Size
7 kB
Vulns
0
Weekly
0
Stars
3

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'
    }
  ]
})

Keywords