0.0.2 • Published 9 months ago

@dinwwwh/unplugin v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@dinwwwh/unplugin

Utility for bundlers

Install

pnpm i @dinwwwh/unplugin

Usage

import { defineConfig } from 'vite'
import unplugin from '@dinwwwh/unplugin'

export default defineConfig({
  plugins: [unplugin.vite()],
})

Besides being used for vite it is also used for all bundlers that unplugin supports.

Features

onSuccess

This plugin will run a command after the build is complete. This is useful for running scripts that need to be run after the build is complete.

import { defineConfig } from 'vite'
import unplugin from '@dinwwwh/unplugin'

export default defineConfig({
  plugins: [unplugin.vite({ onSuccess: 'tsc -b --noCheck' })],
})

Or you can set the UNPLUGIN_ON_SUCCESS environment variable to run a command after the build is complete.

UNPLUGIN_ON_SUCCESS='tsc -b --noCheck' vite build

loadExternal

This will load all packages in dependencies, peerDependencies, optionalDependencies (linked dependencies will recursively load). And smart decide whether to include it in the build or not.

import { defineConfig } from 'vite'
import { loadExternal } from '@dinwwwh/unplugin'

export default defineConfig({
  ssr: {
    noExternal: true,
    external: loadExternal('./package.json'),
  },
})

License

MIT

0.0.2

9 months ago

0.0.1

9 months ago

0.0.0

9 months ago