Skip to content

Commit

Permalink
better solution
Browse files Browse the repository at this point in the history
  • Loading branch information
eltigerchino committed May 16, 2024
1 parent 6191b1a commit e9e1665
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wicked-kangaroos-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/kit": patch
---

fix: correctly handle aliases to files in the `./svelte-kit` directory
8 changes: 7 additions & 1 deletion packages/kit/src/core/sync/write_tsconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ const value_regex = /^(.*?)((\/\*)|(\.\w+))?$/;
*/
function get_tsconfig_paths(config) {
/** @param {string} file */
const config_relative = (file) => posixify('./' + path.relative(config.outDir, file));
const config_relative = (file) => {
let relative_path = path.relative(config.outDir, file);
if (!relative_path.startsWith('..')) {
relative_path = './' + relative_path;
}
return posixify(relative_path);
};

const alias = { ...config.alias };
if (fs.existsSync(project_relative(config.files.lib))) {
Expand Down

0 comments on commit e9e1665

Please sign in to comment.