-
Notifications
You must be signed in to change notification settings - Fork 922
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
snowpack build --watch mode #376
Comments
I'm wondering if this is actually a feature we need to bake in or if we should just rely on some third-party tooling to achieve this functionality. I think you could simply get away with something like this:
Personally, I have very rarely come across a case where I need to fully re-build the production version of my app. |
Thanks for that snippet, I'm sure someone will find that useful. The usecase that I'm aware of is when you need to own the server and can't use One update would be that we do now have better proxying support, which could help some users who were stuck before. https://www.snowpack.dev/#project-relative-imports |
That's not the goal. The goal is My use case is the HTML host page is behind authentication, and/or might also be generated (e.g. to seed data related to the authenticated user). Fwiw, an approach like GWT's superdevmode would work for me: write the entry points to disk and serve everything else by a server with |
I would really like to adopt snowpack and I'm waiting for this feature as well! I'm working with a server-side app that runs inside Vagrant. The best practice for local development with Vagrant is to mount your source code with NFS inside the Vagrant VM and run your As @tbroyer mentions above, this should probably be I am considering writing a custom watch script in the interim. |
Hmm, I guess another alternative is making snowpack more easily consumable as an API (rather than rely on the CLI to accomplish everything...) allowing this sort of thing to live in userland. |
In my use case, the html page is a web view hosted inside an Electron app. To achieve HMR for Electron, I'd imagine a plugin similar to https://github.com/electron-userland/electron-webpack, and that is definitely beyond the scope of this project. UPDATE: I just figured I can request content from the snowpack dev server from Electron shell. No need for watch mode. <script type="module" src="http://localhost:8080/_dist_/index.js"></script> |
Just to give my 👍 for a |
Really looking forward to have this! It can be very useful when we build CLI node apps\utils. |
I need this feature to start using snowpack. I have a java spring boot app, which hosts my react app and I just need to watch my source files with snowpack and dump them into a directory that my spring boot app will serve whenever the source changes. Additionally, I haven't found any way to specify a different directory than |
@wlindner not entirely sure that I follow, Snowpack will mount directories (like |
18 👍 's can't be wrong :) Let's prioritize this! I created a PR with a first draft of this feature: #782 If anyone is excited to get this working and able to help out, I'd love your help testing that PR. |
Merged in #782! Available to test now via |
Very cool! Thanks for the quick turnaround, I installed the next version of snowpack and my initial impression is that it's mostly working. I keep getting a crash and I'm not sure how to reproduce it (sorry 😞). --log-level isn't working, so I just know the exit code was 1. It seems to happen when I've run I'm also surprised how slow it is. I set up my project with a single
Let me know if you need any additional info, I'm happy to help out how I can! |
Whoops, I figured out why I was getting all of those "File changed" log messages. It has to do with the folder structure I was using and that the output of my build was changing files in my src directory. This is not an issue with the |
Awesome, thanks for spinning up the discussion! We have some logging improvements going on right now as well, as soon as we get those merged we'll cut a new release |
I wonder if it'd make sense to also have a |
How is that different from |
Excuse me, I've not tried |
|
Thanks. I see this is probably what I want: NODE_ENV=development yarn -s run snowpack build --watch --no-minify --no-bundle |
Unfortunately either:
or
or
doesn't override import.meta.env specified in |
Sorry if I'm being naive here, but is it possible to run I ask because the dev experience is much better for
|
Also having this behavior with the latest v3 release... trying to use snowpack build because 😕 |
When I try the build in
|
@yalpertem snowpack is essentially unmaintained at this point, I suggest switching to vite instead. |
Thanks for the notice, my bad that I didn't check it first. |
Original Discussion: https://www.pika.dev/npm/snowpack/discuss/257
/cc @1player, @FredKSchott
The text was updated successfully, but these errors were encountered: