Giter Club home page Giter Club logo

Comments (5)

121onto avatar 121onto commented on May 30, 2024 1

I can submit if I have some spare time. Given that webpack consumes extra resources while using these settings, you'd probably want to make it an option (does foreman allow for that?).

In the meantime, here are the steps I took to get this working on Vagrant:

  1. Change all instances of "localhost" to "0.0.0.0" in webpack server configs.
  2. Update rails servers to bind to 0.0.0.0 (using the option -b 0.0.0.0).
  3. Turn firewalls off on vagrant machine, and configure to forward ports 3000, 3500, and 4000.
  4. Patch webpack per the watchpack issue referenced above.

I accomplished step 4 by saving this script to client/watchpack-ignore-node-modules.sh, adding it as a postinstall script in client/package.json, deleting client/node_modules/webpack, and then running npm install.

Add the postinstall script by adding the following line to client/package.json:

{
  ...
  "scripts": {
    ...
    "postinstall": "./watchpack-ignore-node-modules.sh",
    ...
  },
  ...
}

from spree_starter.

damianlegawiec avatar damianlegawiec commented on May 30, 2024

@121onto initial build is always slow (it doesn't have any relation to hot reload btw). Hot reload will only rebuild parts that actually changed (so it should be fast unless you're pasting a huge amount of files into the project at once). For more information on Webpack build process please refer http://webpack.github.io/docs/.

About CSS recompilation speed - we didn't encounter it at work, will keep an eye for this.

from spree_starter.

121onto avatar 121onto commented on May 30, 2024

Thanks @damianlegawiec.

How hard would it be persist a fingerprint of the codebase with each reload. You could compare the fingerprint when starting the server and wipe the webpack directory if and only if the fingerprint changes.

from spree_starter.

121onto avatar 121onto commented on May 30, 2024

I improved performance about 4x by following the suggestions here:

webpack/watchpack#23

This was necessary because I enabled polling in my webpack servers:

var server = new WebpackDevServer(webpack(config), {                                                               
  ...                                                                                 
  watchOptions: {                                                                                                  
      poll: true                                                                                                   
  },                                                                                                               
  ...                                                                                                       
})  

I enabled polling so that webpack would recognize changes to source files while running on a vagrant machine.

from spree_starter.

damianlegawiec avatar damianlegawiec commented on May 30, 2024

@121onto - oh so you were using it inside Vagrant - that explains. Yeah, webpack has some issues running in containers. Could you submit a PR with this change?

from spree_starter.

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.