Skip to content

Commit 6533479

Browse files
authored
fix(cca): Better intellisense for JS apps (#108)
By passing the config straight to `createConfig` also JS apps get intellisense help with setting the correct options
1 parent d9433ca commit 6533479

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

.changesets/108.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- fix(cca): Better intellisense for JS apps (#108) by @Tobbe
2+
3+
By passing the config straight to `createConfig` also JS apps get intellisense help with setting the correct options
4+
5+
For the release notes: This is not a breaking change, but I still recommend
6+
that apps update their config files to stay in sync with our templates
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import dns from 'dns'
22

3-
import type { UserConfig } from 'vite'
43
import { defineConfig } from 'vite'
54

65
import redwood from '@cedarjs/vite'
@@ -9,8 +8,6 @@ import redwood from '@cedarjs/vite'
98
// See: https://vitejs.dev/config/server-options.html#server-host.
109
dns.setDefaultResultOrder('verbatim')
1110

12-
const viteConfig: UserConfig = {
11+
export default defineConfig({
1312
plugins: [redwood()],
14-
}
15-
16-
export default defineConfig(viteConfig)
13+
})

packages/create-cedar-app/templates/js/web/vite.config.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import redwood from '@cedarjs/vite'
88
// See: https://vitejs.dev/config/server-options.html#server-host.
99
dns.setDefaultResultOrder('verbatim')
1010

11-
const viteConfig = {
11+
export default defineConfig({
1212
plugins: [redwood()],
13-
}
14-
15-
export default defineConfig(viteConfig)
13+
})
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import dns from 'dns'
22

3-
import type { UserConfig } from 'vite'
43
import { defineConfig } from 'vite'
54

65
import redwood from '@cedarjs/vite'
@@ -9,8 +8,6 @@ import redwood from '@cedarjs/vite'
98
// See: https://vitejs.dev/config/server-options.html#server-host.
109
dns.setDefaultResultOrder('verbatim')
1110

12-
const viteConfig: UserConfig = {
11+
export default defineConfig({
1312
plugins: [redwood()],
14-
}
15-
16-
export default defineConfig(viteConfig)
13+
})

0 commit comments

Comments
 (0)