Code Monkey home page Code Monkey logo

plugin-lit-refresh's Introduction

@dblechoc/plugin-lit-refresh

Provides Lit HMR support support for Vite. State won't reload, just styles.

Basically dev-server-hmr republished for Vite.

// vite.config.js
import LitRefresh from "@dblechoc/plugin-lit-refresh";

export default {
  plugins: [LitRefresh()],
};

plugin-lit-refresh's People

Contributors

medmunds avatar sync avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

plugin-lit-refresh's Issues

HMR triggered but no update on client side

Hello,

What type of configuration/import/etc do you use for the styles property to have the styles update client side?

Currently, with a clean install of the lit-ts vite template, this plugin configuration, and loading of the css via import

  import componentStyles from './my-element.css'
  static styles = [
    css`${unsafeCSS(componentStyles)}`
  ]

the HMR is triggered but no update is seen client side

currently using

{
   "vite": "^2.8.4",
   "lit": "^2.2.0"
}

also tried using "vite": "^2.3.0", from ~9 month ago when you published the plugin. That seemed to make no difference.

Update Vite peer dependency

Thank you for this library! It's the only lib I could find that fixes my HMR issue. I do however now have to npm i --force due to the dated Vite peer dependency. Could you update the peer dependency to the latest Vite?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.