Skip to content

Commit 70f032f

Browse files
authoredMay 4, 2022
docs: clarify code comments in optimize-missing-deps (#7332)
1 parent 2b58cb3 commit 70f032f

File tree

1 file changed

+3
-2
lines changed
  • packages/playground/optimize-missing-deps

1 file changed

+3
-2
lines changed
 

‎packages/playground/optimize-missing-deps/server.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ async function createServer(root = process.cwd()) {
2525
let template = fs.readFileSync(resolve('index.html'), 'utf-8')
2626
template = await vite.transformIndexHtml(req.originalUrl, template)
2727

28-
// this will import missing deps nest built-in deps that should not be optimized
28+
// `main.js` imports dependencies that are yet to be discovered and optimized, aka "missing" deps.
29+
// Loading `main.js` in SSR should not trigger optimizing the "missing" deps
2930
const { name } = await vite.ssrLoadModule('./main.js')
3031

31-
// this will import missing deps that should be optimized correctly
32+
// Loading `main.js` in the client should trigger optimizing the "missing" deps
3233
const appHtml = `<div id="app">${name}</div>
3334
<script type='module'>
3435
import { name } from './main.js'

0 commit comments

Comments
 (0)