Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pug Files not in the Dev server watch list? #418

Closed
evolutionjay opened this issue Mar 28, 2017 · 1 comment
Closed

Pug Files not in the Dev server watch list? #418

evolutionjay opened this issue Mar 28, 2017 · 1 comment

Comments

@evolutionjay
Copy link

evolutionjay commented Mar 28, 2017

CLI version: 2.8.0

操作步骤

vue init webpack demo
cd demo
npm i 
npm i -D pug pug-loader less less-loader

Add files:

App.js
App.pug
App.less
App.vue

in App.vue

<template lang="pug">
  include ./App.pug
</template>
<script src="./App.js"></script>
<style lang="less" src="./App.less">

⚠️问题

npm run dev

and then in localhost:8080/

when i change or save the App.pug file , the webpack server hot reload not work

pug file not in watch file list?


Sorry, My English is poor , I am try my best to let you know what I say.....

@LinusBorg
Copy link
Member

LinusBorg commented Mar 28, 2017

pug file not in watch file list?

  include ./App.pug

This include is done by pug, not webpack, so webpack isn't aware of it. That'S why hot reloading can't work like that.

Try this:

<template lang="pug" src="./App.pug">
</template>

This way, vue-loader will handle the import, and webpack now knows about the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants