statianzo / webpack-livereload-plugin

LiveReload during webpack --watch
ISC License
203 stars 51 forks source link

how do I have to configure webpack.config.js #62

Open vdeppe opened 4 years ago

vdeppe commented 4 years ago

Hello, I want to use the livereload-plugin in my webApp. But somehow it doesn't work. My Webapp should run on port 8080, which I have defined in devServer. Could you please check my file, which looks as follows?

`const CopyPlugin = require('copy-webpack-plugin'); var LiveReloadPlugin = require('webpack-livereload-plugin');

module.exports = { plugins: [ new LiveReloadPlugin() ], entry: { bundle: ['./app/app.js'] }, output: { path: __dirname + '/public', filename: 'app.js' }, module: { rules: [ { test: /.bpmn$/, use: 'raw-loader' } ] }, devServer: { port: 8080, }, plugins: [ new CopyPlugin({ patterns: [ { from: 'assets/', to: 'vendor/bpmn-js', context: 'node_modules/bpmn-js/dist/' }, { from: '/*.{html,css,png}', context: 'app/' }, ], }), ], mode: 'development', devtool: 'source-map' }; ` thanks and kind regards

statianzo commented 4 years ago

This plugin doesn't serve your webpack assets. It handles livereload in apps that have their assets served by another process.

devServer is for configuring webpack-dev-server which may be what you need.

crisamdegracia commented 3 years ago

Took me many days to make webpack-dev-server work in WordPress coz it needs the HTML file, but I can't. Finally this plugin works!

"webpack-livereload-plugin": "^3.0.1",
"webpack": "^5.33.2",
"webpack-cli": "^4.6.0",  

new LiveReloadPlugin({ protocol: "http", hostname : "understraptest.local", appendScriptTag: true, })