Skip to content

Commit

Permalink
Adapter auto fixes (#2897)
Browse files Browse the repository at this point in the history
* fix detection order

* remove ANSI codes

* changesets
  • Loading branch information
Rich-Harris authored Nov 24, 2021
1 parent b5e5adf commit 61e0b2c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-parrots-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-auto': patch
---

Remove ANSI codes
5 changes: 5 additions & 0 deletions .changeset/twelve-carrots-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-auto': patch
---

Fix platform detection order
10 changes: 5 additions & 5 deletions packages/adapter-auto/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ export const adapters = [
test: () => !!process.env.VERCEL,
module: '@sveltejs/adapter-vercel'
},
{
name: 'Netlify',
test: () => !!process.env.NETLIFY,
module: '@sveltejs/adapter-netlify'
},
{
name: 'Cloudflare Pages',
test: () => !!process.env.CF_PAGES,
module: '@sveltejs/adapter-cloudflare'
},
{
name: 'Netlify',
test: () => !!process.env.NETLIFY,
module: '@sveltejs/adapter-netlify'
}
];
2 changes: 1 addition & 1 deletion packages/adapter-auto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function () {
for (const candidate of adapters) {
if (candidate.test()) {
options.utils.log.info(
`Detected environment: \u001B[1m\u001B[92m${candidate.name}\u001B[39m\u001B[22m. Using ${candidate.module}`
`Detected environment: ${candidate.name}. Using ${candidate.module}`
);

let module;
Expand Down

0 comments on commit 61e0b2c

Please sign in to comment.