chore: reduce diffs with v6 branch (#17942) · vitejs/vite@bf9065a (original) (raw)
`@@ -474,7 +474,7 @@ export async function build(
`
474
474
`'production',
`
475
475
`)
`
476
476
`const options = config.build
`
477
``
`-
const { logger } = config
`
``
477
`+
const { root, logger, packageCache } = config
`
478
478
`const ssr = !!options.ssr
`
479
479
`const libOptions = options.lib
`
480
480
``
`@@ -486,7 +486,7 @@ export async function build(
`
486
486
`),
`
487
487
`)
`
488
488
``
489
``
`-
const resolve = (p: string) => path.resolve(config.root, p)
`
``
489
`+
const resolve = (p: string) => path.resolve(root, p)
`
490
490
`const input = libOptions
`
491
491
` ? options.rollupOptions?.input ||
`
492
492
`(typeof libOptions.entry === 'string'
`
`@@ -641,8 +641,7 @@ export async function build(
`
641
641
`ssrNodeBuild || libOptions
`
642
642
` ? resolveOutputJsExtension(
`
643
643
`format,
`
644
``
`-
findNearestPackageData(config.root, config.packageCache)?.data
`
645
``
`-
.type,
`
``
644
`+
findNearestPackageData(root, packageCache)?.data.type,
`
646
645
`)
`
647
646
` : 'js'
`
648
647
`return {
`
`@@ -665,9 +664,9 @@ export async function build(
`
665
664
`libOptions,
`
666
665
`format,
`
667
666
`name,
`
668
``
`-
config.root,
`
``
667
`+
root,
`
669
668
`jsExt,
`
670
``
`-
config.packageCache,
`
``
669
`+
packageCache,
`
671
670
`)
`
672
671
`` : path.posix.join(options.assetsDir, [name]-[hash].${jsExt}),
``
673
672
`chunkFileNames: libOptions
`
`@@ -702,13 +701,13 @@ export async function build(
`
702
701
`}
`
703
702
``
704
703
`const resolvedOutDirs = getResolvedOutDirs(
`
705
``
`-
config.root,
`
``
704
`+
root,
`
706
705
`options.outDir,
`
707
706
`options.rollupOptions?.output,
`
708
707
`)
`
709
708
`const emptyOutDir = resolveEmptyOutDir(
`
710
709
`options.emptyOutDir,
`
711
``
`-
config.root,
`
``
710
`+
root,
`
712
711
`resolvedOutDirs,
`
713
712
`logger,
`
714
713
`)
`
`@@ -718,10 +717,10 @@ export async function build(
`
718
717
`` logger.info(colors.cyan(\nwatching for file changes...))
``
719
718
``
720
719
`const resolvedChokidarOptions = resolveChokidarOptions(
`
721
``
`-
config,
`
722
720
`config.build.watch.chokidar,
`
723
721
`resolvedOutDirs,
`
724
722
`emptyOutDir,
`
``
723
`+
config.cacheDir,
`
725
724
`)
`
726
725
``
727
726
`const { watch } = await import('rollup')
`