Skip to content

Commit 03e8ff0

Browse files
committed
tidy up, relativise paths consistently
1 parent f77c075 commit 03e8ff0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Diff for: packages/kit/src/core/tsconfig.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ export function generate_tsconfig(config) {
6262

6363
mkdirp(SVELTE_KIT);
6464

65+
/** @param {string} file */
66+
const project_relative = (file) => path.relative('.', file);
67+
68+
/** @param {string} file */
69+
const config_relative = (file) => path.relative(SVELTE_KIT, file);
70+
6571
fs.writeFileSync(
6672
`${SVELTE_KIT}/tsconfig.json`,
6773
JSON.stringify(
@@ -85,16 +91,16 @@ export function generate_tsconfig(config) {
8591
esModuleInterop: true,
8692
skipLibCheck: true,
8793
forceConsistentCasingInFileNames: true,
88-
baseUrl: path.relative(SVELTE_KIT, '.'),
94+
baseUrl: config_relative('.'),
8995
allowJs: true,
9096
checkJs: true,
9197
paths: {
92-
$lib: [path.relative('.', config.kit.files.lib)],
93-
'$lib/*': [path.relative('.', config.kit.files.lib) + '/*']
98+
$lib: [project_relative(config.kit.files.lib)],
99+
'$lib/*': [project_relative(config.kit.files.lib + '/*')]
94100
}
95101
},
96-
include: ['../**/*.d.ts', '../**/*.js', '../**/*.ts', '../**/*.svelte'],
97-
exclude: ['../node_modules/**']
102+
include: ['**/*.d.ts', '**/*.js', '**/*.ts', '**/*.svelte'].map(config_relative),
103+
exclude: ['node_modules/**'].map(config_relative)
98104
},
99105
null,
100106
'\t'

0 commit comments

Comments
 (0)