Possible to set this up when use Vue with Vanilla JS (not .vue)
See original GitHub issueHey I recently posted an issue on vue-router about not being able to properly hot reload vue components with Vanilla JS (at the time I thought it was vue-router).
I have a demo repo here that demonstrates the problem but I will quickly explain it here also.
Basically I am using Vue without .vue
files this is simply because I find my workflow (syntax highlighting, how I structure my SASS, etc…) works better using Vanilla JS files. I am requiring .html
files using the webpack html-loader as the component template like so:
export default {
name: 'Home',
// ...
template: require('./Home.html')
}
<!-- Home.html -->
<div>
<p>
<router-link to="/test-one">Test One</router-link>
</p>
<p>
<router-link to="/test-two">Test Two</router-link>
</p>
</div>
Is there a way I can set up the vue-hot-reload-api to work with this?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
How to add vanilla JavaScript to vue.js project? - Stack Overflow
Vue is a JavaScript framework and therefore you can insert vanilla code anywhere in it and it will run perfectly fine.
Read more >Can you use Vue.js as a general-purpose JavaScript library?
Of course, there are some disadvantages when introducing Vue.js in a project made with vanilla JavaScript, one of which is getting acquainted ...
Read more >Vue.js vs Vanilla.js - what are the differences?
js vs Vanilla JavaScript, Vue could be superior. Without a doubt, a deep knowledge of JavaScript is a big advantage.
Read more >Ways of Using Vue - Vue.js
Vue can be used as a standalone script file - no build step required! If you have a backend framework already rendering most...
Read more >Adding Vue.js to an Existing Project | by Blunt Jackson | Medium
How is v-show doing this? Scroll up and review our Vue app. It included a section called data: const vueApp = new Vue({...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wrote a fork of official webpack template that supports Hot Module Reload out of the box for people who don’t want to use vue-loader and .vue single component files. It also support a TypeScript option.
https://github.com/Toilal/vue-webpack-template
I just found the issue on vue-hot-reload-loader, you can try my Pull Request available on my fork, it works like a charm.