-
Python (
>= 3.12) -
Node.JS (
22.21.1) [Same version as the current Electron release]- Using other versions may work, but you might run into errors while compiling native add-ons
-
A lot of patience
- Linux environments require additional dependencies, please see Linux Specific Pre-reqs
- You will need Build Tools for Visual Studio 2022 (Scroll all the way to the bottom)
- Additionally, you need spectre-mitigated MSVC, go to "Individual Components" and select "MSVC ... - VS2022 C++ Spectre-Mitigated Libs"
- Many native libraries do not support ClangCL well yet, hence we force it to use MSVC in our
.npmrc
git clone https://github.com/peterjthomson/marktext.git
cd marktext
npm install- This is automatically ran when building for production, but not for dev for performance
npm run minify-locales
npm run dev- The
mainandpreloadprocesses are NOT automatically hot-loaded on edit, you need to reload the development process on each edit unfortunately- The good news is Vite bundles it really really quickly so it shouldnt be too big of a hassle
- Although the
rendererprocess is hot-loaded, loss of states can often lead to weird errors. I recommend doing a full reload if this happens - Compile targets:
mainandpreloadstill compile toCommonJSrendererisESModulesonly (take note when using any legacyCommonJSlibraries)
# For windows
$ npm run build:win
# For macOS
$ npm run build:mac
# For Linux
$ npm run build:linux