Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unplugin-auto-import

Package Overview
Dependencies
Maintainers
1
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unplugin-auto-import

Register global imports on demand for Vite and Webpack

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
202K
decreased by-5.23%
Maintainers
1
Weekly downloads
 
Created

What is unplugin-auto-import?

unplugin-auto-import is a powerful tool for automatically importing functions, components, and other modules in your JavaScript or TypeScript projects. It helps to reduce boilerplate code and improve development efficiency by eliminating the need to manually import frequently used modules.

What are unplugin-auto-import's main functionalities?

Automatic Import of Functions

Automatically imports functions from specified libraries (e.g., Vue and Vue Router) without needing to manually import them in each file.

module.exports = {
  plugins: [
    require('unplugin-auto-import/webpack')({
      imports: ['vue', 'vue-router'],
    }),
  ],
};

Custom Imports

Allows you to specify custom imports from libraries like Lodash, so you can use functions like debounce and throttle without manual imports.

module.exports = {
  plugins: [
    require('unplugin-auto-import/webpack')({
      imports: [
        {
          'lodash': [
            'debounce',
            'throttle'
          ]
        }
      ],
    }),
  ],
};

TypeScript Support

Generates TypeScript declaration files for the auto-imported modules, ensuring type safety and better development experience.

module.exports = {
  plugins: [
    require('unplugin-auto-import/webpack')({
      dts: true,
    }),
  ],
};

ESLint Integration

Integrates with ESLint to ensure that auto-imported modules are recognized and do not trigger linting errors.

module.exports = {
  plugins: [
    require('unplugin-auto-import/webpack')({
      eslintrc: {
        enabled: true,
      },
    }),
  ],
};

Other packages similar to unplugin-auto-import

Keywords

FAQs

Package last updated on 24 Aug 2021

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc