Coder Social home page Coder Social logo

Comments (8)

bebraw avatar bebraw commented on May 18, 2024

@glenjamin What if we changed the recommendation to webpack-dev-server inline? That way we wouldn't need an entry at all given it injects one automatically. As a bonus tweaking the ip and port becomes easier.

from webpack-book.

glenjamin avatar glenjamin commented on May 18, 2024

That would work too, the downside being that it's not quite as clear what is going on if you want to tweak the config.

from webpack-book.

bebraw avatar bebraw commented on May 18, 2024

Ok, I'll change it to what you proposed and link to an alternative resource for inline based setup with a bit different ideas.

from webpack-book.

idisblueflash avatar idisblueflash commented on May 18, 2024

I've got error by changing to config of @glenjamin:

What I did:

  • remove <script src="http://localhost:8080/webpack-dev-server.js"></script> in my index.html
  • and add entry: 'webpack-dev-server/client?http://localhost:8080', in webpack.config.js

I've got a blank page and error on console:
[HMR] Waiting for update signal from WDS...
TypeError: undefined is not an object (evaluating 'global.WebSocket')

I try to comment // 'webpack-dev-server/client?http://localhost:8080', first page is ok, but I didn't get Automatic browser refresh. Did I miss some thing?

from webpack-book.

bebraw avatar bebraw commented on May 18, 2024

Any idea @glenjamin? Do you have working configuration to compare against?

from webpack-book.

glenjamin avatar glenjamin commented on May 18, 2024

I'll try and dig one out - I haven't used this for a while as I've moved to using my webpack-dev-middleware instead.

from webpack-book.

glenjamin avatar glenjamin commented on May 18, 2024

Looks like the approach I describe is the same one react-hot-boilerplate currently uses.

https://github.com/gaearon/react-hot-boilerplate/blob/3883f8ac7181aa42eed2485e7c72ea7599d7792e/webpack.config.js

from webpack-book.

MacgyverMartins avatar MacgyverMartins commented on May 18, 2024

I had the some error @idisblueflash and I fix it changing npm script from:
"dev": "webpack-dev-server --devtool eval --progress --colors --content-base build"
to:
"dev": "webpack-dev-server --devtool eval --progress --colors --hot --content-base build"

from webpack-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.