scripts: externalize fsevents

This commit is contained in:
thecodrr
2021-07-07 01:35:47 +05:00
parent d907f43266
commit 53d381cc3f
3 changed files with 1 additions and 38 deletions

View File

@@ -23,7 +23,6 @@
"zx": "^2.0.0"
},
"scripts": {
"bundle": "esbuild ./electron.js ./preload.js --minify --external:electron --bundle --outdir=./build --platform=node",
"release": "yarn zx ./scripts/publish.mjs"
},
"author": {

View File

@@ -12,6 +12,6 @@ cd(`${__dirname}${sep}..${sep}`);
await $`yarn copyfiles -a ..${sep}build .${sep}build`;
await $`yarn bundle`;
await $`esbuild .${sep}electron.js .${sep}preload.js --minify --external:electron --external:fsevents --bundle --outdir=.${sep}build --platform=node`;
await $`electron-builder -c.extraMetadata.main=.${sep}build${sep}electron.js`;

View File

@@ -1,36 +0,0 @@
# Go to notes-web directory
cd ../
# Generate the web app build
if ! yarn install; then
echo "Failed to install web app dependencies."
exit
fi
# Generate the web app build
if ! yarn build:desktop; then
echo "Failed to build web app."
exit
fi
# Change back to desktop directory
cd ./desktop
# Copy build files to desktop folder
# NOTE: we have to do this because electron-builder cannot work in parent directories.
if ! yarn copyfiles -a ../build ./build; then
echo "Could not copy build files."
exit
fi
# Generate electron specific bundle
if ! yarn bundle; then
echo "Could not generate electron bundle"
exit
fi
# Build and publish
if ! electron-builder -c.extraMetadata.main=./build/electron.js; then
echo "Failed to build and publish electron builds"
exit
fi