From 5bdac79254cac258f02d2fdd4a8c6e03fc7299a4 Mon Sep 17 00:00:00 2001 From: Shibo Lyu Date: Sat, 4 Jan 2025 01:45:28 +0800 Subject: [PATCH] feat: bundled build --- .gitignore | 1 + package.json | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6736aa1..00ec099 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules index.js +index.bundled.js* diff --git a/package.json b/package.json index 35b6771..ed6895b 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,10 @@ "description": "S3 Storage adapter for Ghost.", "main": "index.js", "scripts": { - "build": "esbuild ./src/index.js --bundle --outfile=index.js --platform=node --format=cjs --target=node16 --packages=external --footer:js='module.exports = module.exports.default;'", - "prepublishOnly": "npm run build", + "build:traditional": "esbuild ./src/index.js --bundle --outfile=index.js --platform=node --format=cjs --target=node16 --packages=external --footer:js='module.exports = module.exports.default;'", + "build:bundled": "esbuild ./src/index.js --bundle --minify --outfile=index.bundled.js --platform=node --format=cjs --target=node16 --packages=bundle --legal-comments=external --footer:js='module.exports = module.exports.default;'", + "build": "pnpm build:traditional && pnpm build:bundled", + "prepublishOnly": "pnpm build", "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Shibo Lyu ",