From 17eed26c2dda8f2d3900e7e21b243364feaa89b7 Mon Sep 17 00:00:00 2001 From: Okiki Ojo Date: Mon, 30 May 2022 01:21:02 +0000 Subject: [PATCH] chore: netlify --- .netlify/netlify-plugin-pnpm/index.js | 10 ++++++++++ .netlify/netlify-plugin-pnpm/manifest.yml | 2 ++ netlify.toml | 8 ++++++++ package.json | 1 - 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .netlify/netlify-plugin-pnpm/index.js create mode 100644 .netlify/netlify-plugin-pnpm/manifest.yml create mode 100644 netlify.toml diff --git a/.netlify/netlify-plugin-pnpm/index.js b/.netlify/netlify-plugin-pnpm/index.js new file mode 100644 index 0000000..38b62c5 --- /dev/null +++ b/.netlify/netlify-plugin-pnpm/index.js @@ -0,0 +1,10 @@ +module.exports = { + onPreBuild: async ({ utils: { build, run } }) => { + try { + await run.command("npm install -g pnpm") + await run.command("pnpm install --frozen-lockfile=false") + } catch (error) { + return build.failBuild(error) + } + } +} \ No newline at end of file diff --git a/.netlify/netlify-plugin-pnpm/manifest.yml b/.netlify/netlify-plugin-pnpm/manifest.yml new file mode 100644 index 0000000..afed29f --- /dev/null +++ b/.netlify/netlify-plugin-pnpm/manifest.yml @@ -0,0 +1,2 @@ +name: netlify-plugin-pnpm +inputs: [] \ No newline at end of file diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..5e84180 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,8 @@ +[build] + command = "npm run build" + +[build.environment] + NPM_FLAGS="--prefix=/dev/null" + +[[plugins]] + package = "/.netlify/netlify-plugin-pnpm" \ No newline at end of file diff --git a/package.json b/package.json index 6c2bcd6..2fef811 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "private": true, "license": "MIT", "scripts": { - "prebuild": "test \"$CI\" = true && npx pnpm install -r --store=node_modules/.pnpm-store || echo skipping pnpm install", "dev": "astro dev", "start": "astro dev", "build": "astro build", -- knotmirror 0.0.1