Skip to content

Commit de736f9

Browse files
authored
[fix] clear adapter-static output (#2260)
1 parent f6d318e commit de736f9

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.changeset/large-horses-flash.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-static': patch
3+
---
4+
5+
Clear output before adapting

packages/adapter-static/index.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
/**
2-
* @param {{
3-
* pages?: string;
4-
* assets?: string;
5-
* fallback?: string;
6-
* }} [opts]
7-
*/
1+
/** @type {import('.')} */
82
export default function ({ pages = 'build', assets = pages, fallback } = {}) {
9-
/** @type {import('@sveltejs/kit').Adapter} */
10-
const adapter = {
3+
return {
114
name: '@sveltejs/adapter-static',
125

136
async adapt({ utils }) {
7+
utils.rimraf(assets);
8+
utils.rimraf(pages);
9+
1410
utils.copy_static_files(assets);
1511
utils.copy_client_files(assets);
1612

@@ -21,6 +17,4 @@ export default function ({ pages = 'build', assets = pages, fallback } = {}) {
2117
});
2218
}
2319
};
24-
25-
return adapter;
2620
}

0 commit comments

Comments
 (0)