microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
710 stars 589 forks source link

How to force `pxt serve` to build projects locally (no cloud compiler) #5798

Open microbit-carlos opened 1 month ago

microbit-carlos commented 1 month ago

When serving MakeCode locally using the following commands + flags + env variables, it builds DAL/CODAL locally, then opens the MakeCode editor in a browser window, and any TS-only projects there uses the local build.

git clone https://github.com/microsoft/pxt-microbit.git
cd pxt-microbit
npm install pxt --no-save
npm install
# YOTTA_GITHUB_AUTHTOKEN needed to fetch all DAL yotta dependencies without being rate limited by GH
YOTTA_GITHUB_AUTHTOKEN=xxxx PXT_NODOCKER=1 PXT_FORCE_LOCAL=1 PXT_RUNTIME_DEV=1 npx pxt serve --local

However, when a C++ extension (like the audio recording) is added, it will invoke the cloud compiler to build the project, instead of using the local tooling.

image

Is there a way to force the served editor to build the user project locally as well?

riknoll commented 1 month ago

that's not supported by our local server today, though could be added maybe. not trivial though