Get Vite's `import.meta.hot` at runtime

Overview

vite-hot-client

NPM version

Get Vite's import.meta.hot at runtime.

You don't normally need this library directly. It's designed for embedded UI on top of Vite for client-server communication. For example:

Install

npm i vite-hot-client

Usage

import { hot } from 'vite-hot-client'

// import.meta.hot
if (hot) {
  hot.on('update', () => {
    // ...
  })
}
import { createHotContext } from 'vite-hot-client'

const hot = createHotContext('/path/to/module')

if (hot) {
  // ...
}

Sponsors

License

MIT License © 2022 Anthony Fu

You might also like...

Dojo - meta information for the project.

Dojo - meta information for the project.

dojo-meta This repository contains information regarding Dojo (versions 2 and newer) that crosses package boundaries. Visit us at dojo.io for document

Nov 22, 2022

Tool made to easily merge multiple GTA 5 vehicle meta files.

mmVehiclesMetaMerger Tool made to easily merge multiple GTA5 vehicle meta files. Showcase Go to Youtube video. Download Click here to go to the releas

Jan 2, 2023

Bruh. Generalized Meta transaction dispatcher.

metuh A generalized meta-transaction library for Ethereum-flavour chains. Not overengineered like all of OpenZeppelin. Inspired heavily by the Lens Di

Mar 22, 2022

Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 📋

nuxt-social-tags Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 ✨ Release Notes 📖 Read the documentation Features Nuxt3 ready Composables

Dec 17, 2022

Utilities for meta-level interactions with the Prisma toolkit in Node.js.

@prisma-spectrum/reflector Utilities for meta-level interactions with the Prisma toolkit in Node.js. ⚠️ Warning: This is not a formal Prisma product l

Dec 16, 2022

POC. Simple plugin-based meta-programming platform on top of Typescript

comp-plugins POC Running: yarn to install dependencies yarn dev to run the script The what The script creates a new typescript compiler instance (prog

Jul 14, 2022

Functions and objects that make it easier to add fields to Portable Text editors for accessibility meta information, like language changes or abbreviations.

Porta11y Porta11y is a collection of accessibility-focused annotations, decorators and validators for Sanity’s Portable Text editor. Portable Text is

Aug 25, 2022

The fullstack Angular meta-framework

The fullstack Angular meta-framework

Analog Analog is a meta-framework for building applications and websites with Angular. Getting Started Use your package manager of choice to create a

Dec 23, 2022

It redirects the website request from facebook to any blog while keeping the meta data for the each link.

Vercel Redirect It redirects the website request from facebook to any blog while keeping the meta data for the each link. This app uses Next.js and th

Dec 4, 2022

:zap: RAN! React . GraphQL . Next.js Toolkit :zap: - SEO-Ready, Production-Ready, SSR, Hot-Reload, CSS-in-JS, Caching, CLI commands and more...

:zap: RAN! React . GraphQL . Next.js Toolkit :zap: - SEO-Ready, Production-Ready, SSR, Hot-Reload, CSS-in-JS, Caching, CLI commands and more...

RAN : React . GraphQL . Next.js Toolkit New version is coming... Follow up here: https://github.com/Sly777/ran/issues/677 Features Hot-Reload Ready fo

Jan 3, 2023

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

A comprehensive starter kit for rapid application development using React. Why Slingshot? One command to get started - Type npm start to start develop

Dec 22, 2022

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in

A comprehensive starter kit for rapid application development using React. Why Slingshot? One command to get started - Type npm start to start develop

Jan 3, 2023

Express js webserver integration with edgejs templating engine using webpack assets manager and hot reloading

Express js webserver integration with edgejs templating engine using webpack assets manager and hot reloading

Feb 12, 2022

A minimal, modern, generic, hot-reloading local web server to help web developers

eleventy-dev-server 🕚 ⚡️ 🎈 🐀 A minimal, modern, generic, hot-reloading local web server to help web developers. ➡ Documentation Please star Elevent

Dec 31, 2022

Experimenting with vite typescript template rewrite for hot.opensauced.pizza

Experimenting with vite typescript template rewrite for hot.opensauced.pizza

🍕 Open Sauced Vite Typescript Template Test 🍕 The path to your next Open Source contribution 📖 Prerequisites In order to run the project we need th

Mar 11, 2022

fcall, fetch and call any remote hot functions, anywhere, anytime, without installations or configurations.

fcall, fetch and call any remote hot functions, anywhere, anytime, without installations or configurations.

Sep 20, 2022

Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod

Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod

Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod Intro This boilerplate is made for creating chrome extensions

Dec 27, 2022

The self-building, hot-reloading subgraph. The quickest way to start indexing your shit.

npx autographed The self-building, hot-reloading subgraph. The quickest way to start indexing your shit. 🚀 getting started Okay, so there's a lot tha

Aug 21, 2022

Hot-challenge-solving application for any coding challenge services.

✔️ Solv Hot-challenge-solving application for any coding challenge services. Introduction Solv [sɑːlv] is a cli application for solving coding challen

Dec 13, 2022
Comments
  • No

    No "exports" main defined

    Hi,

    I'm trying to code a plugin for Vite.

    To do that, I would use 'import.meta.hot' in my plugin (published as a library).

    When i try to use the hot context you provide, I get the error error during build: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/fbml1984/projet/vite-editor/node_modules/vite-hot-client/package.json

    Do you have an idea how to fix this issue ?

    opened by fredlnl 0
Releases(v0.1.1)
Owner
Anthony Fu
A ship in harbor is safe, but that is not what ships are built for.
Anthony Fu
Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 📋

nuxt-social-tags Easy generation of OpenGraph & Twitter meta-tags in Nuxt 3 ✨ Release Notes ?? Read the documentation Features Nuxt3 ready Composables

Conner 19 Dec 17, 2022
The fullstack Angular meta-framework

Analog Analog is a meta-framework for building applications and websites with Angular. Getting Started Use your package manager of choice to create a

null 583 Dec 23, 2022
Experimenting with vite typescript template rewrite for hot.opensauced.pizza

?? Open Sauced Vite Typescript Template Test ?? The path to your next Open Source contribution ?? Prerequisites In order to run the project we need th

TED Vortex (Teodor-Eugen Duțulescu) 3 Mar 11, 2022
Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod

Chrome Extension Boilerplate with SolidJS + Vite + TypeScript + Manifest V3 + Hot Relaod Intro This boilerplate is made for creating chrome extensions

fuyutarow 34 Dec 27, 2022
Automatically detect and import components or modules

vite-plugin-autoimport Automatically detect and import components or modules. Motivation It's very common to have many components in one file as the p

Yuan Chuan 146 Dec 23, 2022
Vue2.x plugin to create scoped or global shortcuts. No need to import a vue component into the template.

vue2-shortcut Vue2.x plugin to create scoped or global shortcuts. No need to import a vue component into the template. Install $ npm install --save vu

Graxi 37 Aug 14, 2022
Get visual feedback that HMR completed

vite-plugin-notifier Provides visual feedback that HMR has completed. Only runs in dev mode. Example Setup To install the package: npm i --save-dev vi

Joshua Nussbaum 33 Dec 29, 2022
Change import URLs in JavaScript code using import maps. e.g. `import * from "before"` to `import * from "after"`

esm-import-transformer Can transform any ESM source code import URLs using an import maps object. This package works in ES modules or in CJS. // Befor

Zach Leatherman 19 Jul 31, 2022
The design experiment for import.meta.glob from Vite.

vite-plugin-glob The design experiment for import.meta.glob from Vite. Motivations There are quite some scenarios that import.meta.glob wasn't conside

Anthony Fu 166 Sep 17, 2022
🎧 Get json type billboard hot 100 chart

Billboard json Get json type billboard hot 100 chart, Data update every day !! Url Hot 100 : https://raw.githubusercontent.com/KoreanThinker/billboard

Hyun 13 Dec 31, 2022