File tree 1 file changed +3
-12
lines changed
packages/vite/src/node/server 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ SOFTWARE.
30
30
*/
31
31
32
32
import fs from 'node:fs'
33
- import { join , resolve } from 'node:path'
33
+ import { join } from 'node:path'
34
34
import { performance } from 'node:perf_hooks'
35
- import { createRequire } from 'node:module '
35
+ import { VERSION as rollupVersion } from 'rollup '
36
36
import type {
37
37
AsyncPluginHooks ,
38
38
CustomPluginOptions ,
@@ -173,18 +173,9 @@ export async function createPluginContainer(
173
173
174
174
const watchFiles = new Set < string > ( )
175
175
176
- // TODO: use import()
177
- const _require = createRequire ( import . meta. url )
178
-
179
- // get rollup version
180
- const rollupPkgPath = resolve (
181
- _require . resolve ( 'rollup' ) ,
182
- '../../package.json'
183
- )
184
176
const minimalContext : MinimalPluginContext = {
185
177
meta : {
186
- rollupVersion : JSON . parse ( fs . readFileSync ( rollupPkgPath , 'utf-8' ) )
187
- . version ,
178
+ rollupVersion,
188
179
watchMode : true
189
180
}
190
181
}
You can’t perform that action at this time.
0 commit comments