Skip to content

Commit

Permalink
[fix] Allow absolute file paths given to package.dir (#3012)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostdevv committed Dec 11, 2021
1 parent 5a6a2dc commit 484ea9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gold-colts-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Allow absolute file paths given to package.dir
3 changes: 2 additions & 1 deletion packages/kit/src/packaging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const essential_files = ['README', 'LICENSE', 'CHANGELOG', '.gitignore', '.npmig
* @param {string} cwd
*/
export async function make_package(config, cwd = process.cwd()) {
const abs_package_dir = path.join(cwd, config.kit.package.dir);
const package_dir = config.kit.package.dir;
const abs_package_dir = path.isAbsolute(package_dir) ? package_dir : path.join(cwd, package_dir);
rimraf(abs_package_dir);

if (config.kit.package.emitTypes) {
Expand Down

0 comments on commit 484ea9a

Please sign in to comment.