Comments (5)
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:
- Change all instances of "localhost" to "0.0.0.0" in webpack server configs.
- Update rails servers to bind to 0.0.0.0 (using the option -b 0.0.0.0).
- Turn firewalls off on vagrant machine, and configure to forward ports 3000, 3500, and 4000.
- 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.
@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.
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.
I improved performance about 4x by following the suggestions here:
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.
@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)
- Docker Compose + Headless Spree + Nextjs Frontend build HOT 3
- spree_sample no images Docker HOT 2
- Installation error on Windows 11 WSL2 - PG::UndefinedTable: ERROR: relation "spree_countries" does not exist
- error in heroku
- Create Spree CLI for bootstraping an application with Rails/Vue/React storefronts
- Fix test suite on CircleCI
- Running bin/start-docker returns errors HOT 1
- Command "start-hybrid" spins up container with web app HOT 1
- Nokogiri Error on fresh install HOT 8
- We're sorry, but something went wrong. If you are the application owner check the logs for more information. HOT 1
- I finished setup but when upload logo, it always not display
- No routes working except admin HOT 1
- install failed HOT 9
- install failed on macOS Big Sur M1 Chip HOT 9
- Please guide to run a production build for the same HOT 17
- *** stack smashing detected ***: terminated HOT 1
- "*** stack smashing detected ***: terminated" on M1 Apple Silicon HOT 4
- Fresh install gives sprocket error re: spree-dashboard.js HOT 2
- Product Form Fields Show Duplicates HOT 2
- Creating test file instead of creating spec file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spree_starter.