unplugin-unused-files
v0.1.1
Published
Register global imports on demand for Vite and Webpack
Downloads
1
Maintainers
Readme
unplugin-unused-files
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()],
})