Skip to content

Commit

Permalink
[fix] clear adapter-static output (#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb committed Aug 21, 2021
1 parent f6d318e commit de736f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-horses-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-static': patch
---

Clear output before adapting
16 changes: 5 additions & 11 deletions packages/adapter-static/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
/**
* @param {{
* pages?: string;
* assets?: string;
* fallback?: string;
* }} [opts]
*/
/** @type {import('.')} */
export default function ({ pages = 'build', assets = pages, fallback } = {}) {
/** @type {import('@sveltejs/kit').Adapter} */
const adapter = {
return {
name: '@sveltejs/adapter-static',

async adapt({ utils }) {
utils.rimraf(assets);
utils.rimraf(pages);

utils.copy_static_files(assets);
utils.copy_client_files(assets);

Expand All @@ -21,6 +17,4 @@ export default function ({ pages = 'build', assets = pages, fallback } = {}) {
});
}
};

return adapter;
}

0 comments on commit de736f9

Please sign in to comment.