Skip to content

Commit

Permalink
feat: directly resolve VChartServer as server halve of VChart
Browse files Browse the repository at this point in the history
  • Loading branch information
kingyue737 committed Jul 12, 2024
1 parent dc84ccf commit 7ecb586
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
20 changes: 15 additions & 5 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,26 @@ export default defineNuxtModule<ModuleOptions>({

addComponentsDir({
path: resolve('./runtime/components'),
ignore: options.ssr ? undefined : ['VChart.*'],
ignore: ['VChart.*'],
})
if (!options.ssr)
if (!options.ssr) {
addComponent({
name: 'VChart',
// ts extension is keeped because of type bug
// https://github.com/nuxt/nuxt/issues/28087
filePath: resolve('./runtime/components/VChart.client.ts'),
filePath: resolve('./runtime/components/VChart'),
mode: 'all',
})
} else {
addComponent({
name: 'VChart',
filePath: resolve('./runtime/components/VChart'),
mode: 'client',
})
addComponent({
name: 'VChart',
filePath: resolve('./runtime/components/VChartServer'),
mode: 'server',
})
}

nuxt.options.css.unshift(resolve('./runtime/style.css'))

Expand Down
8 changes: 0 additions & 8 deletions src/runtime/components/VChart.server.ts

This file was deleted.

File renamed without changes.

0 comments on commit 7ecb586

Please sign in to comment.