another unrelated questi…

1 minute read

another unrelated question… the documentation implies that you can create custom “builders” to do whatever you want. I created one, which uses run-commands, but when I run it, the WDS is also spun up… why? What determines if wds is started?

Responses:

what is WDS?

Starting type checking service... ℹ 「wds」: Project is running at <http://0.0.0.0:8080/> ℹ 「wds」: webpack output is served from / ℹ 「wds」: Content not from webpack is served from /&lt;PATH_TO_MY_REPO/apps/my-app/src ℹ 「wds」: 404s will fallback to /index.html

or is that coming from preact?

What commands are in your run command?

My guess is that preact uses webpack for its dev server (but I have no idea)

yeah looks like it’s preact… just didn’t see that spat out when i ran it myself, but I’m suspecting there are some path issues… it subsequently falls on it’s arse with a bunch of these ERROR in undefined(undefined,undefined): TS5055: Cannot write file '&lt;some-source-file&gt;.js' because it would overwrite input file.

something clearly not happy… similar error as when I run the preact build… I’ll dig some more through this

(the main problem seems to stem from preact wanting to be run from the app root, but also expecting the node modules there… so I’m jumping through a few hoops, and failing)

FYI it turned out to be a missing webpack loader (bad config)… looks like it’s all good now :slightly_smiling_face:

Hi, Getting the same issue, which loader should I add?

Best

Hey - ugh, lemme cast my mind back to see if I can remember what that one was about

Thanks

I think the thing that ultimately solved it was (a) ensuring all node modules were installed aat the root of the mono repo, and (b) making sure you run preact from the root, but pass it the config, src and dest: "builder": "@nrwl/workspace:run-commands", "options": { "color": true, "parallel": false, "commands": [ { "command": "npx preact build --config apps/myapp/preact.config.js --src apps/myapp/src --dest ./dist/apps/myapp" } ] },

but that’s all I can figure out

Updated: