question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using plugin serve with watch option

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
andrejcremoznikcommented, Aug 20, 2017

What’s the holdup for releasing this to npm?

1reaction
thghcommented, Aug 1, 2017

Thanks for reporting 😃

I’m not sure how to fix it. PRs welcome!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found