Comments (6)
Hi! I have read through your issue a couple of times now and … I must be missing something, because I just don’t get, like, much at all 😅 I don’t really get your setup, what it would look like with elm make
, what you would like to be dynamic, and what is a hack.
Not sure if it makes sense for your case, but at work we generate elm-watch.json, and I’ve seen some other folks do that too when they’ve had complicated requirements.
from elm-watch.
Oh no! Sorry it wasn’t clear. Let me try to clarify.
When I run turbo build
, I want a JS file to show up in the Elm output package under build
. When I run turbo package
, I want the same package but under dist
to match the convention.
When I run the hot server, I need the output to end up in a totally different package so the hot reloads work properly.
So what I’d like to be dynamic: only the output location. What feels like a hack: the combination of duplicating target definitions and hardcoding a cross-package path.
I suppose we could generate an elm-watch file but that’s adding a lot of machinery to do something like this!
Regardless, I’m not blocked from using elm-watch and I super appreciate you making and releasing it! The DX is so great in the browser! I just wanted to raise this as something I had to work around.
from elm-watch.
Does this mean that you call elm-watch make
from turbo
somehow? Btw, is it turborepo or turbopack? (I have never used those, just heard about them.)
from elm-watch.
yes, that's exactly it. Under the covers it's doing the equivalent of npm run build
, but with caching and a build graph on top.
from elm-watch.
I think I have a good idea now: The beta version already supports import
:ing elm-watch (https://lydell.github.io/elm-watch/server/#custom-server). We could then support passing in the stuff from elm-watch.json as an argument instead of having elm-watch read it as a file.
You’d replace elm-watch make
with node my-elm-watch.mjs
:
// my-elm-watch.mjs
import elmWatch from "elm-watch";
elmWatch(["make"], {
"elm-watch.json": {
postprocess: ["elm-watch-node", "postprocess.js"],
port: 9876,
targets: {
"My target name": {
inputs: [
"src/Main.elm"
],
output: "build/main.js"
}
}
}
})
.then((exitCode) => {
process.exit(exitCode);
})
.catch((error) => {
console.error("Unexpected elm-watch error:", error);
});
from elm-watch.
ah, yeah, that'd work! Then output
could be like process.argv[3]
or use whatever arg parsing framework. 👍
from elm-watch.
Related Issues (20)
- Missing "resolved" and "integrity" from lock file HOT 5
- Ability to set domain for websocket server HOT 3
- Ability to set domain for websocket server HOT 1
- source-directories with big ancestor directory → file watcher error HOT 2
- Running 'example-minimal' in devcontainer wsl2 - not picking up changes to *.elm HOT 2
- Runtime error after build with --optimize HOT 10
- Getting the error `Error: spawn Unknown system error -8` when using Node 18 HOT 9
- Allow overriding the output file for a target HOT 6
- Allow building a file with the hot-reload code inserted HOT 1
- File changes made don't trigger hot reload - WSL2
- RFC: Overhaul HTTPS support HOT 13
- how would you use elm-optimize-level-2 with elm-watch? HOT 2
- Command line is too long error HOT 1
- using a known hostname but dynamic port HOT 8
- Add output to postprocess arguments HOT 2
- Permission denied when running as root HOT 2
- elm-watch hangs on error HOT 6
- watching through symlinks HOT 1
- elm-watch hangs on error in dependency stage HOT 5
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 elm-watch.