You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

unplugin

Package Overview
Dependencies
Maintainers
0
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unplugin

Unified plugin system for build tools


Version published
Weekly downloads
6.4M
increased by2.2%
Maintainers
0
Install size
1.15 MB
Created
Weekly downloads
 

Package description

What is unplugin?

The unplugin npm package is a framework-agnostic plugin system designed to create plugins that work across different build tools like Webpack, Vite, Rollup, and more. It allows developers to write a plugin once and have it compatible with multiple build systems without the need to rewrite it for each one.

What are unplugin's main functionalities?

Virtual Modules

Create virtual modules that can be imported by your code. These modules don't exist on the filesystem but are created on the fly by the plugin.

unplugin.createPlugin({
  resolveId(id) {
    if (id === 'virtual-module') return id;
  },
  load(id) {
    if (id === 'virtual-module') return 'export default "This is virtual!"';
  }
});

Transformations

Apply custom transformations to your code. This can be used to modify the source code of files before they are bundled.

unplugin.createPlugin({
  transform(code, id) {
    if (id.endsWith('.custom')) {
      return code.replace(/find/g, 'replace');
    }
  }
});

Custom Build Steps

Execute custom code at different stages of the build process. This can be used to perform tasks before or after the build.

unplugin.createPlugin({
  buildStart() {
    console.log('Build started!');
  },
  buildEnd() {
    console.log('Build finished!');
  }
});

Other packages similar to unplugin

Changelog

Source

1.11.0 (2024-06-30)

Bug Fixes

  • await writeBundle hook in webpack and rspack (#390) (5ab1a7b)

Readme

Source

Unplugin

npm version npm downloads License

Unified plugin system for build tools.

Currently supports:

Documentations

Learn more on the Documentation

License

MIT License © 2021-PRESENT Nuxt Contrib

FAQs

Package last updated on 30 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc