We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0dccbcf commit 4c05f49Copy full SHA for 4c05f49
packages/fluent-vue-loader/src/index.ts
@@ -31,6 +31,20 @@ export default function (Component) {
31
const target = Component.options || Component
32
target.fluent = target.fluent || {}
33
target.fluent['${query.locale}'] = new FluentResource(\`${data}\`)
34
+
35
+ if (module.hot) {
36
+ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined' ) {
37
+ // Vue 3
38
+ const id = target.__hmrId
39
+ const api = __VUE_HMR_RUNTIME__
40
+ api.reload(id, target)
41
+ } else {
42
+ // Vue 2
43
+ // There is no proper api to access HMR for component from custom block
44
+ // so use this magic
45
+ delete target._Ctor
46
+ }
47
48
}\n`
49
}
50
0 commit comments