mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-31 19:51:36 +08:00

since we build TS and webpack ourselves and are not using any electron-forge plugins (at least at the moment) -> we should use the "build" folder as build context for electron-forge: in comparison to running electron-forge in the root folder of the project, this avoids electron-forge from packing the source code multiple times (e.g. once as uncompiled TS, then as compiled JS, and then (partially) a third time as webpack bundled JS files), same as some of the assets. to achieve this, we run our usual TS/Webpack build process, but then install the npm dependencies *inside* the build folder (as otherwise electron-forge would choke on the missing node_modules it and abort building). In theory we could avoid cd-ing into the build folder, by providing the "dir" as argument to electron-forge's CLI -- BUT that wouldn't play well with our CI, where we are passing --arch and --platform options to it, which need to come *before* the dir argument. since we now cd into the "build" folder, we also need to adjust the path in package.json "main" again