Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stops package from breaking when given absolute path #3012

Merged
merged 4 commits into from
Dec 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
---

doesn't break if abs is given to package
ghostdevv marked this conversation as resolved.
Show resolved Hide resolved
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