Skip to content

Commit

Permalink
fix(create-app): update svelte templates to use named export of vite-… (
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikg authored Jun 11, 2021
1 parent df15f2b commit c69f836
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/create-app/template-svelte-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.7",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.11",
"@tsconfig/svelte": "^2.0.1",
"svelte": "^3.37.0",
"svelte-check": "^2.1.0",
Expand All @@ -17,4 +17,4 @@
"typescript": "^4.3.2",
"vite": "^2.3.7"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const sveltePreprocess = require('svelte-preprocess')
import sveltePreprocess from 'svelte-preprocess'

module.exports = {
export default {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: sveltePreprocess()
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/template-svelte-ts/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
import svelte from '@sveltejs/vite-plugin-svelte'
import { svelte } from '@sveltejs/vite-plugin-svelte'

// https://vitejs.dev/config/
export default defineConfig({
Expand Down
4 changes: 2 additions & 2 deletions packages/create-app/template-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"serve": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.7",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.11",
"svelte": "^3.37.0",
"vite": "^2.3.7"
}
}
}
2 changes: 1 addition & 1 deletion packages/create-app/template-svelte/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'vite'
import svelte from '@sveltejs/vite-plugin-svelte'
import { svelte } from '@sveltejs/vite-plugin-svelte'

// https://vitejs.dev/config/
export default defineConfig({
Expand Down

2 comments on commit c69f836

@RussBaz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After manually adding these changes to a freshly created project (svelte-ts), I am getting the following error:

import sveltePreprocess from 'svelte-preprocess'
^^^^^^

SyntaxError: Cannot use import statement outside a module

Leaving it as .mjs without changing to .js fixes my issue. Am I missing some other changes? Thanks.

@dsonet
Copy link
Contributor

@dsonet dsonet commented on c69f836 Jun 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was.cjs, were you changed to .mjs and fixed the issue?

Please sign in to comment.