mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-18 00:02:28 +08:00
build(copy-dist): move "pruning" to copy-dist from copy-trilium.sh
This commit is contained in:
parent
1640000291
commit
8977492981
@ -1,5 +1,6 @@
|
|||||||
import fs from "fs-extra";
|
import fs from "fs-extra";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import { execSync } from "node:child_process";
|
||||||
|
|
||||||
const DEST_DIR = "./build";
|
const DEST_DIR = "./build";
|
||||||
|
|
||||||
@ -56,6 +57,9 @@ try {
|
|||||||
|
|
||||||
console.log("Copying complete!")
|
console.log("Copying complete!")
|
||||||
|
|
||||||
|
// TriliumNextTODO: for Docker this needs to run separately *after* build-stage
|
||||||
|
console.log("Pruning npm packages...")
|
||||||
|
execSync(`npm ci --omit=dev --prefix ${DEST_DIR}`);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
console.error("Error during copy:", err)
|
console.error("Error during copy:", err)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
|
@ -13,9 +13,6 @@ fi
|
|||||||
# Patch package.json main
|
# Patch package.json main
|
||||||
sed -i 's|./dist/electron-main.js|electron-main.js|g' "$BUILD_DIR/package.json"
|
sed -i 's|./dist/electron-main.js|electron-main.js|g' "$BUILD_DIR/package.json"
|
||||||
|
|
||||||
# run in subshell (so we return to original dir)
|
|
||||||
(cd $BUILD_DIR && npm ci --omit=dev)
|
|
||||||
|
|
||||||
if [[ -d "$BUILD_DIR"/node_modules ]]; then
|
if [[ -d "$BUILD_DIR"/node_modules ]]; then
|
||||||
# cleanup of useless files in dependencies
|
# cleanup of useless files in dependencies
|
||||||
for d in 'image-q/demo' \
|
for d in 'image-q/demo' \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user