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

(feat) support ESM configs #930

Merged
merged 10 commits into from
Apr 6, 2021

Conversation

dummdidumm
Copy link
Member

@dummdidumm dummdidumm commented Mar 31, 2021

With this PR config loading switches to using dynamic import statements. The PR consists of

  • rework of the config loader to make sure to not load the same config twice in parallel, and to load all possible sub-svelte-configs upon tsconfig initialization, so that all configs are available synchronously to all snapshots that are retrieved. throwing out cosmiconfig in that process.
  • resulting tedious make this function async modifications since the ts service initialization is now async
    Support ESM Syntax in config files #509

Simon Holthausen added 3 commits March 31, 2021 19:06
@dummdidumm dummdidumm marked this pull request as ready for review April 1, 2021 14:24
@dummdidumm dummdidumm requested a review from jasonlyu123 April 1, 2021 14:30
@jasonlyu123
Copy link
Member

I'll take a look next week.

@dummdidumm dummdidumm merged commit 78df663 into sveltejs:master Apr 6, 2021
@dummdidumm dummdidumm deleted the async-config-loader branch April 6, 2021 14:14
dummdidumm added a commit that referenced this pull request Apr 7, 2021
Node versions prior to v12.17 need the `--experimental-modules` flag or the dynamic import introduced in #930 won't work. This node version is used in VS Code versions prior to 1.55 and could be used by users setting the node executable to a node version below 12.17.

Remove this in mid 2022 and bump vs code minimum required version to 1.55
@ryanfiller
Copy link

ryanfiller commented Apr 8, 2021

This is the greatest PR I've ever seen in my life (well, in the last month anyways). Any idea what release this will be a part of? It doesn't look like this is working yet as of 1.0.0-next.71.

@dummdidumm
Copy link
Member Author

I think SvelteKit is hardcoded to using svelte.config.cjs . I wanted to wait a little for possible "this broke" feedback before proceeding with a PR over at SvelteKit

@ryanfiller
Copy link

Ah, gotcha. I was linked to this PR from the Discord and didn't pay attention to what repo this is in. Either way, super great work! I hope this is able to land in Kit eventually, it would make my life (and hopefully other's) a LOT easier.

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.

3 participants