Using plugin serve with watch option
See original GitHub issueI’m not sure if I’m using this incorrectly or it is a “bug”. I’m trying to use this plugin with the watch option. The first time it runs ok, It looks like the socket is kept open. The second time I run the build it reports the port is already in use.
It only happens while using the watch option but it is completely fine without it.
Here is my rollup.config.js
import commonjs from "rollup-plugin-commonjs";
import resolve from "rollup-plugin-node-resolve";
import babel from "rollup-plugin-babel";
import uglify from "rollup-plugin-uglify";
import serve from "rollup-plugin-serve";
import livereload from "rollup-plugin-livereload";
const DISTFOLDER = "dist";
export default {
entry: "src/main.js",
format: "iife",
moduleName: "app",
plugins: [
resolve({ jsnext: true, main: true }),
commonjs(),
babel({ exclude: "node_modules/**" }),
uglify(),
serve({ contentBase: DISTFOLDER, port: 8080 }),
livereload({ watch: DISTFOLDER })
],
external: [],
dest: `${DISTFOLDER}/bundle.js`
};
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Watch and WatchOptions | webpack
In webpack-dev-server and webpack-dev-middleware watch mode is enabled by default. watchOptions. object. A set of options used to customize watch mode: webpack.
Read more >rollup-plugin-serve - npm
Start using rollup-plugin-serve in your project by running `npm i ... are 158 other projects in the npm registry using rollup-plugin-serve.
Read more >webpack-plugin-serve - Interview with Andrew Powell
webpack-plugin-serve - A Development Server in a webpack Plugin ... watch option keeps the process running, so the server doesn't have to.
Read more >How to Serve a Single Page Application (SPA) using Rollup.js ...
In that article, I covered the necessary steps to have a Project Setup ... stands for a compiler option to run the compiler...
Read more >Plugins - esbuild
Make sure you have appropriate synchronization in place if your plugin uses any shared data structures. #On-resolve options. The onResolve API is meant...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What’s the holdup for releasing this to npm?
Thanks for reporting 😃
I’m not sure how to fix it. PRs welcome!