0.1.1 • Published 1 year ago

unplugin-unused-files v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

unplugin-unused-files

NPM version

Install

npm i unplugin-unused-files
// vite.config.ts
import UnusedFiles from 'unplugin-unused-files/vite'

export default defineConfig({
  plugins: [
    UnusedFiles({ /* options */ }),
  ],
})

Example: playground/

// rollup.config.js
import UnusedFiles from 'unplugin-unused-files/rollup'

export default {
  plugins: [
    UnusedFiles({ /* options */ }),
  ],
}

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-unused-files/webpack')({ /* options */ })
  ]
}

// nuxt.config.js
export default {
  buildModules: [
    ['unplugin-unused-files/nuxt', { /* options */ }],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-unused-files/webpack')({ /* options */ }),
    ],
  },
}

// esbuild.config.js
import { build } from 'esbuild'
import UnusedFiles from 'unplugin-unused-files/esbuild'

build({
  plugins: [UnusedFiles()],
})