docs/docs/vite.config.js   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 26
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 18
mnd 0
bc 0
fnc 1
dl 0
loc 26
rs 10
bpm 0
cpm 1
noi 1
c 0
b 0
f 0
1
import { defineConfig } from 'vite'
2
import SitemapPlugin from 'rollup-plugin-sitemap'
3
import VitePressConfig from './.vitepress/config.js'
4
5
const docsSiteBaseUrl = 'https://nystudio107.com'
6
const docsBaseUrl = new URL(VitePressConfig.base, docsSiteBaseUrl).href.replace(/\/$/, '') + '/'
0 ignored issues
show
Bug introduced by
The variable URL seems to be never declared. If this is a global, consider adding a /** global: URL */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
7
const siteMapRoutes = VitePressConfig.themeConfig.sidebar.map(element => ({
8
  path: element.link.replace(/^\/+/, ''),
9
  name: element.text
10
}))
11
12
// https://vitejs.dev/config/
13
export default defineConfig({
14
  plugins: [
15
    SitemapPlugin({
16
      baseUrl: docsBaseUrl,
17
      contentBase: './docs/.vitepress/dist',
18
      routes: siteMapRoutes,
19
    })
20
  ],
21
  server: {
22
    host: '0.0.0.0',
23
    port: 3002,
24
    strictPort: true,
25
  }
26
});
27