question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible to set this up when use Vue with Vanilla JS (not .vue)

See original GitHub issue

Hey 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:open
  • Created 7 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
Toilalcommented, Mar 20, 2017

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

1reaction
Toilalcommented, Mar 16, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found