-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The manifest.json file updates without running build #1232
Comments
Oh, okay, I see what's going on. Whenever you run either Maybe this is more of a feature request then, but would it be possible to have it not do that? Could node create a different folder somewhere and the PHP API connects to it if in development mode or something? It's just really a hassle to have the entire dist folder blown away whenever I save something in development. The dist folder shouldn't be something that's used for development purposes: it should be intended for production distribution after a build only. (See for example). |
Hi, I don't understand why you'd want that though.
If you want the whole output to be saved somewhere except the dist directory, then change the option in wpackio.project.js file. |
Also, I will write some docs on how we can use wpackio for Gutenberg blocks. We are successfully using it in our team. |
Gutenberg docs would be helpful! I have it set up and working well for my blocks already, but it'd be excellent to see a more official setup for achieving that. So, maybe I'm using the tool incorrectly and you could help me understand a better approach. I suppose my question tl;dr is, what URL do you use when you're adding content (especially images) within wp-admin? How do you develop and then use blocks with the script paths always changing? I don't think it's good to access wp-admin through the IP address wpack.io gives me, because any images I upload for instance get saved like http://192.168.0.233:3000/wp-content/uploads/2021/06/example.jpg and only work while Normally, I just access the site through whatever URL I set up through Docker or Local or MAMP, so every URL saved to the database is exactly the same and work without wpack.io running a development server (so http://example.test/wp-content/uploads/2021/06/example.jpg, with all URLs being under http://example.test). All my wp-admin work is done using that URL, so all URLs in the database are consistent and are easy to find and replace later for launch. My coworkers can use that same URL and not need to worry about what my IP address was the last time I was adding content. However, right now, I can run the build, start entering content at http://example.test/wp-admin, notice I'd like some title's color to be blue instead of red or what have you, and as soon as I save that stylesheet, http://example.test/wp-admin reports all my wpack.io scripts as 404'ing and all my blocks as not being registered as a result. I'd much prefer http://example.test to keep working with the incorrect blue colored headings and wait for me to choose to run a build at the time I choose to, rather than having any development changes cause every block I've created to stop working. Normally, running a development build should not cause any prior production build to stop working. I do a lot of Gatsby development: Is that making sense? |
Well you are right about that. But at this moment, I do not have the mileage to work on this change, as it sounds like a major thing. Among internal things, we have to somehow inform Wpackio\Enqueue about which directory to use But if you think you can come up with a solution, I will gladly review your PR and merge. |
Okay thanks, I'll see if I can get some time to look into it once my current project is nearing finish. |
When I run
npm run build
, files are generated in my dist folder as I'd expect, including a manifest.json file listing the files it built with the cache-breaking suffixes added, and visiting directly (i.e. http://example.local-by-flywheel.test rather than http://localhost:3000) works great. However, as soon as I save anything with the development server running, the manifest.json file changes, breaking all the enqueues when I visit directly.Is this the intended behavior? I would expect the dist folder to remain untouched unless
npm run build
gets run.As an example, here's what's generated for
npm run build
:That works great and I can visit http://example.local-by-flywheel.test with functioning styling and scripts, with or without the
npm run start
running.But then, if
npm run start
is running and I save anything that the development server is watching, the manifest.json changes to the following:That breaks all the asset links for http://example.local-by-flywheel.test. So for instance, instead of loading common-9154df4b.css which does exist in the dist folder, it tries to load common.css instead which doesn't exist, so it 404's. Again, http://localhost:3000 works fine, but the actual site at http://example.local-by-flywheel.test is looking for the wrong files.
Why this is important to me is because I'm using wpack.io for Gutenberg development, so if I visit http://example.local-by-flywheel.test/wp-admin and try to navigate to a page to edit it, the block editor is broken since it can't find the files it's looking for unless I run
npm run build
every time after I save anything with the development environment. I can log into http://localhost:3000/wp-admin if I need to, but then all my URLs get entered using http://localhost:3000 instead of http://example.local-by-flywheel.test, so I need to search and replace all those in the database later.The text was updated successfully, but these errors were encountered: