Comments (2)
hi @pierreberchtold ,
regarding your questions:
- in flynt 1 we used browsersync. this meant, that we proxied the entire wordpress server on a specific port. in order to get live reload, etc. you had to visit this port either with localhost:3000, for example, or with LOCAL_IP:3000. vite works a bit different. in dev mode, files are not written to the disk but served from memory through a separate dev server. this is why we have to include the asset files from the dev server and cannot just use a file on disk through wordpress' web server.
as a result, the regular domain you set up for wordpress now automatically includes live reload, etc. but this also means that we not take care of exposing you wordpress installation in the local network. now you have to take care of this yourself. that means, if you run wordpress on a port on localhost, for example with wp-env and also bind that to you local ip, you will be able to access that ip from a different device in your network. i hope that makes sense.
you might additionally need to bind the vite dev server to 0.0.0.0 or ::1 instead of localhost in order to access the compiled assets from the local network as well. let me know if i can support you in that. - if you local wordpress instance runs on http, you do not need any certificates and can just use vite dev server without any extra config. if, however, you server wordpress with https, the vite dev server should also run in secure mode, otherwise most browsers will reject the loading of the assets or the websocket connection. this is why we advice you provide a trusted ssl certificate and key through the environment variables. for development, we use mkcert and can use the same certificates as we use for our wordpress server. here you can find more info and also a link to a vite plugin for an alternative way to get a certificate. this will cause warnings in the browser though.
in general, the setup is not a bit different and requires different strategies than before. however, the development experience does improve a lot with vite, it generates more modern bundles and compiles a lot faster that anything we did before.
hope this helps and you can find the best setup for you. let me know if you need anything else.
from flynt.
Hi @domtra ! Thank you very much for your detailed answer.
Using vite is for sure a nice update. I guess we will define our own best practices for our team concerning testing localy on a mobile device.
from flynt.
Related Issues (20)
- composer install not working twig/cache-extension is abandoned HOT 15
- How to link scripts correctly HOT 4
- How to implement conditional_logic? HOT 2
- Is there a good way to bulk create posts with components? HOT 1
- Minor front and back end issues HOT 4
- Not Getting meta data in GridPostsLatest HOT 6
- Can it be used with a hosted wordpress with limited ssh? HOT 1
- Build Fails HOT 3
- similar build issue on Windows HOT 6
- How to use repo within docker containers - DDEV HOT 6
- Migration Guide HOT 1
- How to add tailwind? HOT 1
- Can't access development site from external device
- How can we call the shortcodes in flynt ? HOT 1
- Flynt v2.1: Cannot correctly save ACF Field Groups HOT 6
- flynt 2.1.1 'Fatal Error' @ twig 3.10 deprecation in Timber src HOT 4
- CDN emojis not available HOT 1
- Theme Size and Production Steps for Local to Live domain HOT 8
- Assertion traceback too verbose
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 flynt.