fix(scripts): install production dependencies before compiling binaries and exclude local node_modules from builds
This commit is contained in:
@@ -8,36 +8,40 @@ set -e
|
||||
VERSION=$(grep '"version"' deno.json | cut -d'"' -f4)
|
||||
echo "Compiling Onebox v${VERSION} for all platforms..."
|
||||
|
||||
# Install only transitively imported dependencies (skips devDependencies from package.json)
|
||||
echo "Installing production dependencies..."
|
||||
deno install --entrypoint mod.ts
|
||||
|
||||
# Create dist directory
|
||||
mkdir -p dist/binaries
|
||||
|
||||
# Compile for each platform
|
||||
# Compile for each platform (--node-modules-dir=none avoids bundling local node_modules)
|
||||
echo "Compiling for Linux x64..."
|
||||
deno compile --allow-all --no-check \
|
||||
deno compile --allow-all --no-check --node-modules-dir=none \
|
||||
--output "dist/binaries/onebox-linux-x64" \
|
||||
--target x86_64-unknown-linux-gnu \
|
||||
mod.ts
|
||||
|
||||
echo "Compiling for Linux ARM64..."
|
||||
deno compile --allow-all --no-check \
|
||||
deno compile --allow-all --no-check --node-modules-dir=none \
|
||||
--output "dist/binaries/onebox-linux-arm64" \
|
||||
--target aarch64-unknown-linux-gnu \
|
||||
mod.ts
|
||||
|
||||
echo "Compiling for macOS x64..."
|
||||
deno compile --allow-all --no-check \
|
||||
deno compile --allow-all --no-check --node-modules-dir=none \
|
||||
--output "dist/binaries/onebox-macos-x64" \
|
||||
--target x86_64-apple-darwin \
|
||||
mod.ts
|
||||
|
||||
echo "Compiling for macOS ARM64..."
|
||||
deno compile --allow-all --no-check \
|
||||
deno compile --allow-all --no-check --node-modules-dir=none \
|
||||
--output "dist/binaries/onebox-macos-arm64" \
|
||||
--target aarch64-apple-darwin \
|
||||
mod.ts
|
||||
|
||||
echo "Compiling for Windows x64..."
|
||||
deno compile --allow-all --no-check \
|
||||
deno compile --allow-all --no-check --node-modules-dir=none \
|
||||
--output "dist/binaries/onebox-windows-x64.exe" \
|
||||
--target x86_64-pc-windows-msvc \
|
||||
mod.ts
|
||||
|
||||
Reference in New Issue
Block a user