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

babel-plugin-transform-vite-meta-hot

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-vite-meta-hot

babel plugin that emulates vite's import.meta.hot functionality

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
57K
increased by14.68%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-vite-meta-hot

Build Status codecov version downloads MIT License

PRs Welcome Code of Conduct Discord

Watch on GitHub Star on GitHub Tweet

Please note: this plugin is intended to provide an approximation of some of Vite specific transformations when running the code in non-Vite environment, for example, running tests with a NodeJS based test runner.

The functionality within these transformations should not be relied upon in production.

Example

In

if (import.meta.hot) {
  import.meta.hot.accept(callback);
}

Out

if (module.hot) {
  module.hot.accept(callback);
}

Installation

npm install --save-dev babel-plugin-transform-vite-meta-hot

Usage

{
  "plugins": ["babel-plugin-transform-vite-meta-hot"]
}

Via CLI

babel --plugins babel-plugin-transform-vite-meta-hot script.js

Via Node API

require('@babel/core').transformSync('code', {
  plugins: ['babel-plugin-transform-vite-meta-hot']
})

Keywords

FAQs

Package last updated on 22 Jan 2023

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