File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import { defineAdditionalConfig , type DefaultTheme } from 'vitepress'
3-
4- const require = createRequire ( import . meta. url )
5- const pkg = require ( 'vitepress/package.json' )
2+ import { version } from 'vitepress/package.json' with { type : 'json' }
63
74export default defineAdditionalConfig ( {
85 description : 'Vite & Vue powered static site generator.' ,
@@ -40,7 +37,7 @@ function nav(): DefaultTheme.NavItem[] {
4037 activeMatch : '/reference/'
4138 } ,
4239 {
43- text : pkg . version ,
40+ text : version ,
4441 items : [
4542 {
4643 text : '1.6.4' ,
Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import {
32 defineAdditionalConfig ,
43 type DefaultTheme ,
54 type MarkdownLocaleOptions
65} from 'vitepress'
7-
8- const require = createRequire ( import . meta. url )
9- const pkg = require ( 'vitepress/package.json' )
6+ import { version } from 'vitepress/package.json' with { type : 'json' }
107
118export const markdown : MarkdownLocaleOptions = {
129 container : {
@@ -92,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
9289 activeMatch : '/es/reference/'
9390 } ,
9491 {
95- text : pkg . version ,
92+ text : version ,
9693 items : [
9794 {
9895 text : '1.6.4' ,
Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import {
32 defineAdditionalConfig ,
43 type DefaultTheme ,
54 type MarkdownLocaleOptions
65} from 'vitepress'
7-
8- const require = createRequire ( import . meta. url )
9- const pkg = require ( 'vitepress/package.json' )
6+ import { version } from 'vitepress/package.json' with { type : 'json' }
107
118export const markdown : MarkdownLocaleOptions = {
129 container : {
@@ -100,7 +97,7 @@ function nav(): DefaultTheme.NavItem[] {
10097 activeMatch : '/reference/'
10198 } ,
10299 {
103- text : pkg . version ,
100+ text : version ,
104101 items : [
105102 {
106103 text : '1.6.4' ,
Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import {
32 defineAdditionalConfig ,
43 type DefaultTheme ,
54 type MarkdownLocaleOptions
65} from 'vitepress'
7-
8- const require = createRequire ( import . meta. url )
9- const pkg = require ( 'vitepress/package.json' )
6+ import { version } from 'vitepress/package.json' with { type : 'json' }
107
118export const markdown : MarkdownLocaleOptions = {
129 container : {
@@ -63,7 +60,7 @@ function nav(): DefaultTheme.NavItem[] {
6360 activeMatch : '/reference/'
6461 } ,
6562 {
66- text : pkg . version ,
63+ text : version ,
6764 items : [
6865 {
6966 text : '1.6.4' ,
Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import {
32 defineAdditionalConfig ,
43 type DefaultTheme ,
54 type MarkdownLocaleOptions
65} from 'vitepress'
7-
8- const require = createRequire ( import . meta. url )
9- const pkg = require ( 'vitepress/package.json' )
6+ import { version } from 'vitepress/package.json' with { type : 'json' }
107
118export const markdown : MarkdownLocaleOptions = {
129 container : {
@@ -92,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
9289 activeMatch : '/ko/reference/'
9390 } ,
9491 {
95- text : pkg . version ,
92+ text : version ,
9693 items : [
9794 {
9895 text : '1.6.4' ,
Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import {
32 defineAdditionalConfig ,
43 type DefaultTheme ,
54 type MarkdownLocaleOptions
65} from 'vitepress'
7-
8- const require = createRequire ( import . meta. url )
9- const pkg = require ( 'vitepress/package.json' )
6+ import { version } from 'vitepress/package.json' with { type : 'json' }
107
118export const markdown : MarkdownLocaleOptions = {
129 container : {
@@ -92,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
9289 activeMatch : '/pt/reference/'
9390 } ,
9491 {
95- text : pkg . version ,
92+ text : version ,
9693 items : [
9794 {
9895 text : '1.6.4' ,
Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import {
32 defineAdditionalConfig ,
43 type DefaultTheme ,
54 type MarkdownLocaleOptions
65} from 'vitepress'
7-
8- const require = createRequire ( import . meta. url )
9- const pkg = require ( 'vitepress/package.json' )
6+ import { version } from 'vitepress/package.json' with { type : 'json' }
107
118export const markdown : MarkdownLocaleOptions = {
129 container : {
@@ -90,7 +87,7 @@ function nav(): DefaultTheme.NavItem[] {
9087 activeMatch : '/ru/reference/'
9188 } ,
9289 {
93- text : pkg . version ,
90+ text : version ,
9491 items : [
9592 {
9693 text : '1.6.4' ,
Original file line number Diff line number Diff line change 1- import { createRequire } from 'node:module'
21import {
32 defineAdditionalConfig ,
43 type DefaultTheme ,
54 type MarkdownLocaleOptions
65} from 'vitepress'
7-
8- const require = createRequire ( import . meta. url )
9- const pkg = require ( 'vitepress/package.json' )
6+ import { version } from 'vitepress/package.json' with { type : 'json' }
107
118export const markdown : MarkdownLocaleOptions = {
129 container : {
@@ -92,7 +89,7 @@ function nav(): DefaultTheme.NavItem[] {
9289 activeMatch : '/zh/reference/'
9390 } ,
9491 {
95- text : pkg . version ,
92+ text : version ,
9693 items : [
9794 {
9895 text : '1.6.4' ,
Original file line number Diff line number Diff line change 6262 "build" : " pnpm build:prepare && pnpm build:client && pnpm build:node && node scripts/genWebTypes.ts" ,
6363 "build:prepare" : " pnpm clean && node scripts/copyShared.ts" ,
6464 "build:client" : " vue-tsc --noEmit -p src/client && tsc -p src/client && node scripts/copyClient.ts" ,
65- "build:node" : " tsc -p src/node --noEmit && rollup --config rollup.config.ts --configPlugin esbuild " ,
65+ "build:node" : " tsc -p src/node --noEmit && rollup --config rollup.config.ts" ,
6666 "test" : " pnpm --aggregate-output --reporter=append-only '/^test:(types|unit|e2e|init)$/'" ,
6767 "test:types" : " tsc -p __tests__/unit && tsc -p __tests__/e2e && tsc -p __tests__/init && vue-tsc -p docs" ,
6868 "test:unit" : " vitest run -r __tests__/unit" ,
Original file line number Diff line number Diff line change @@ -4,14 +4,12 @@ import json from '@rollup/plugin-json'
44import { nodeResolve } from '@rollup/plugin-node-resolve'
55import replace from '@rollup/plugin-replace'
66import { rm } from 'node:fs/promises'
7- import { builtinModules , createRequire } from 'node:module'
7+ import { builtinModules } from 'node:module'
88import { fileURLToPath } from 'node:url'
99import { type RollupOptions , defineConfig } from 'rollup'
1010import dts from 'rollup-plugin-dts'
1111import esbuild from 'rollup-plugin-esbuild'
12-
13- const require = createRequire ( import . meta. url )
14- const pkg = require ( './package.json' )
12+ import pkg from './package.json' with { type : 'json' }
1513
1614const DEV = ! ! process . env . DEV
1715const PROD = ! DEV
You can’t perform that action at this time.
0 commit comments