vuejs / vue-loader

📦 Webpack loader for Vue.js components
MIT License
4.98k stars 915 forks source link

Vue-next (vue v3.0): enabling hot-reloading capability when webpack target is `node` #1737

Open shubhamzanwar opened 3 years ago

shubhamzanwar commented 3 years ago

What problem does this feature solve?

This functionality allows custom renderers (that do not render to the browser) to enable HMR in their applications. Ex: https://github.com/nodegui/vue-nodegui => This is a desktop app library and the target eventually is node. It would be nice if vue-nodegui developers could use HMR while developing

What does the proposed API look like?

Adding a enableServerHMR flag in the vue-loader options.

{
  test: /\.vue$/,
  use: {
    loader: 'vue-loader',
    options: {
      // ... other options,
      enableServerHMR: true
    }
  },
}

I've also created a PR to implement this: https://github.com/vuejs/vue-loader/pull/1731/files Please check :)

shubhamzanwar commented 3 years ago

Can someone please give this a look?