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

fix(create-app): svelte templates use type module (fixes #3834) #3835

Merged
merged 3 commits into from
Jun 22, 2021

Conversation

dominikg
Copy link
Contributor

Description

fix #3834 use type module so imports in svelte.config.js work as expected

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

packages/create-app/template-svelte-ts/package.json Outdated Show resolved Hide resolved
@patak-dev
Copy link
Member

@dominikg we are not using type: 'module' in any of the others templates, will this be the standard for svelte from now on? Is SvelteKit also using type: 'module'?

@dominikg
Copy link
Contributor Author

@dominikg we are not using type: 'module' in any of the others templates, will this be the standard for svelte from now on? Is SvelteKit also using type: 'module'?

sveltekit uses it
https://github.com/sveltejs/kit/blob/master/packages/create-svelte/templates/default/package.template.json#L13

vite-plugin-svelte still offers a cjs fallback so you can use commonjs if you really have to but it is discouraged.

patak-dev
patak-dev previously approved these changes Jun 16, 2021
@bluwy
Copy link
Member

bluwy commented Jun 17, 2021

@dominikg Could this be related to this line in vite-plugin-svelte?

Since we're not using the typescript compiler in the build process there, reverting this line to use normal await import() could fix this. (Haven't tested this yet)

EDIT: Doesn't work :( Only works in node v14

@patak-dev patak-dev requested a review from antfu June 19, 2021 19:43
@dominikg
Copy link
Contributor Author

any chance this can get merged and ceate-app released with it? still causing issues #3907

@patak-dev patak-dev merged commit ddefe84 into vitejs:main Jun 22, 2021
@patak-dev
Copy link
Member

@dominikg @vitejs/[email protected] has been released

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.

Dev server fails to run on unmodified svelte-ts template
5 participants