Va1 / browser-sync-webpack-plugin

Easily use BrowserSync in your Webpack project.
MIT License
370 stars 42 forks source link

How to reload html files #10

Closed MrLuisAmador closed 8 years ago

MrLuisAmador commented 8 years ago

Hello, I'm literally 2 hours into learning how to use Webpack. I'm trying to move away from using Gulp. I found your plugin and all is good. My one thing is trying to get my html file to reload the page when I edit and save them. I tried adding the index.html file name to the entry property in the array but that only seems to work when I save the main.js file. Only then will my index.html file show its new edits.

Do you have any advice on what I should do?

My webpack.config.js file: var BrowserSyncPlugin = require('browser-sync-webpack-plugin');

module.exports = { entry: ['index.html', './main.js'], output: { path: __dirname, filename: 'bundle.js' },

plugins: [ new BrowserSyncPlugin({ // browse to http://localhost:3000/ during development, // ./public directory is being served host: 'localhost', port: 3000, server: { baseDir: ['./'] } }) ] }