Skip to content

Trigger a manual page refresh on a WebpackDevServer instance #1073

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

Closed
MarlBurroW opened this issue Sep 10, 2017 · 2 comments
Closed

Trigger a manual page refresh on a WebpackDevServer instance #1073

MarlBurroW opened this issue Sep 10, 2017 · 2 comments
Labels

Comments

@MarlBurroW
Copy link

MarlBurroW commented Sep 10, 2017

Hello,

I'm working on a fullstack project with a NodeJs express backend.

In development mode, I would like the WebpackDevServer perform a simple refresh when I save a "pug/jade" template (these templates are not compiled by webpack, it's just served and rendered by express).

To summarize, I need this:

const compiler = webpack(config)
const server =  new WebpackDevServer(compiler, {...})

// Here I watch changes in my backend templates folder and want to 
// perform something like this when a template changes:

server.refresh() // Perform a simple page reload without run the webpack compilation

Is there a way to do this in the current version ?

Thanks

@MarlBurroW MarlBurroW changed the title Trigger a manual page refresh on a WebpackDevServer instance. Trigger a manual page refresh on a WebpackDevServer instance Sep 10, 2017
@MarlBurroW
Copy link
Author

MarlBurroW commented Sep 10, 2017

Ok found this reading the sources:

 server._watch('./backend/views/**/*')

It's an internal method so probably not the "proper" way, but it does the job.

@shellscape
Copy link
Contributor

@MarlBurroW please note that when you see an issue template, it's typically required. be cool and fill it out in the future please. our template states:

Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). Questions will be closed.

Closing as question

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

No branches or pull requests

2 participants