File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed
Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,13 @@ if (!process.argv.includes('--lsp')) {
1313import { createRequire } from 'node:module' ;
1414import { dirname , join } from 'node:path' ;
1515import { pathToFileURL } from 'node:url' ;
16+ import pkg from '../package.json' with { type : 'json' } ;
1617
1718const require = createRequire ( import . meta. url ) ;
1819const oxfmtMainPath = require . resolve ( 'oxfmt' ) ;
1920const oxfmtBin = join ( dirname ( dirname ( oxfmtMainPath ) ) , 'bin' , 'oxfmt' ) ;
2021
22+ // This allows oxfmt to load vite.config.ts
23+ // For `vp check` and `vp fmt`, see `src/utils/constants.ts`
24+ process . env . VP_VERSION = pkg . version ;
2125await import ( pathToFileURL ( oxfmtBin ) . href ) ;
Original file line number Diff line number Diff line change @@ -13,9 +13,13 @@ if (!process.argv.includes('--lsp')) {
1313import { createRequire } from 'node:module' ;
1414import { dirname , join } from 'node:path' ;
1515import { pathToFileURL } from 'node:url' ;
16+ import pkg from '../package.json' with { type : 'json' } ;
1617
1718const require = createRequire ( import . meta. url ) ;
1819const oxlintMainPath = require . resolve ( 'oxlint' ) ;
1920const oxlintBin = join ( dirname ( dirname ( oxlintMainPath ) ) , 'bin' , 'oxlint' ) ;
2021
22+ // This allows oxlint to load vite.config.ts
23+ // For `vp check` and `vp lint`, see `src/utils/constants.ts`
24+ process . env . VP_VERSION = pkg . version ;
2125await import ( pathToFileURL ( oxlintBin ) . href ) ;
Original file line number Diff line number Diff line change @@ -37,4 +37,7 @@ export const DEFAULT_ENVS = {
3737 JS_RUNTIME_NAME : process . release . name ,
3838 // Indicate that vite-plus is the package manager
3939 NODE_PACKAGE_MANAGER : 'vite-plus' ,
40+ // This allows oxlint/oxfmt to load vite.config.ts
41+ // For bin wrapper, see `bin/oxlint` and `bin/oxfmt`
42+ VP_VERSION : VITE_PLUS_VERSION ,
4043} as const ;
You can’t perform that action at this time.
0 commit comments