Skip to content

feat(sveltekit): Read hook file paths from svelte.config.js#253

Merged
Lms24 merged 1 commit intolms/sveltekit-supportfrom
lms/sveltekit-read-svelte-config
Apr 20, 2023
Merged

feat(sveltekit): Read hook file paths from svelte.config.js#253
Lms24 merged 1 commit intolms/sveltekit-supportfrom
lms/sveltekit-read-svelte-config

Conversation

@Lms24
Copy link
Copy Markdown
Member

@Lms24 Lms24 commented Apr 19, 2023

To respect custom hooks file locations that users can specifiy in svelte.config.js, we import the svelte config and use these custom paths if they're available. Otherwise, we fall back to the default paths.

This PR adjusts the tsconfig.json to use node16 module resolution and code generation. This allows us to keep using tsc for the moment and preserve await import calls (so that they're not transpiled to require). I checked and it seems like the transpiled code is mostly equal to what we had before. However, reading the config will only work if users are using Node 16+. For older Node versions, the wizard will emit a warning and instruct people to use it with Node 16. IMO this is fine for the SvelteKit setup flow because SvelteKit requires Node 16 anyway as a minimum version.

closes #247

#skip-changelog

@Lms24 Lms24 requested review from a team, AbhiPrasad and mydea and removed request for a team April 19, 2023 15:31
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 19, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against bb44c3f

@Lms24 Lms24 merged commit eb5bdc4 into lms/sveltekit-support Apr 20, 2023
@Lms24 Lms24 deleted the lms/sveltekit-read-svelte-config branch April 20, 2023 12:10
Lms24 added a commit that referenced this pull request Apr 21, 2023
To respect custom hooks file locations that users can specifiy in `svelte.config.js`, we import the svelte config and use these custom paths if they're available. Otherwise, we fall back to the default paths.
Lms24 added a commit that referenced this pull request May 3, 2023
To respect custom hooks file locations that users can specifiy in `svelte.config.js`, we import the svelte config and use these custom paths if they're available. Otherwise, we fall back to the default paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants