From ee1a686abf69db8a4026ed5462615766f222c29a Mon Sep 17 00:00:00 2001 From: Lioness100 Date: Sun, 12 Feb 2023 12:09:49 -0500 Subject: [PATCH] chore: fix typos (#12032) --- packages/vite/src/node/optimizer/optimizer.ts | 2 +- packages/vite/src/node/plugins/importAnalysisBuild.ts | 2 +- packages/vite/src/node/ssr/ssrStacktrace.ts | 6 +++--- playground/optimize-deps/index.html | 4 ++-- playground/worker/worker/main-classic.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/vite/src/node/optimizer/optimizer.ts b/packages/vite/src/node/optimizer/optimizer.ts index 47d9c1733a6ac3..19c3c472fad576 100644 --- a/packages/vite/src/node/optimizer/optimizer.ts +++ b/packages/vite/src/node/optimizer/optimizer.ts @@ -546,7 +546,7 @@ async function createDepsOptimizer( id, file: getOptimizedDepPath(id, config, ssr), src: resolved, - // Assing a browserHash to this missing dependency that is unique to + // Adding a browserHash to this missing dependency that is unique to // the current state of known + missing deps. If its optimizeDeps run // doesn't alter the bundled files of previous known dependencies, // we don't need a full reload and this browserHash will be kept diff --git a/packages/vite/src/node/plugins/importAnalysisBuild.ts b/packages/vite/src/node/plugins/importAnalysisBuild.ts index 8b63dcf731eb9b..20bcb6449e12f2 100644 --- a/packages/vite/src/node/plugins/importAnalysisBuild.ts +++ b/packages/vite/src/node/plugins/importAnalysisBuild.ts @@ -165,7 +165,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin { // The importerUrl is passed as third parameter to __vitePreload in this case `function(dep, importerUrl) { return new URL(dep, importerUrl).href }` : // If the base isn't relative, then the deps are relative to the projects `outDir` and the base - // is appendended inside __vitePreload too. + // is appended inside __vitePreload too. `function(dep) { return ${JSON.stringify(config.base)}+dep }` const preloadCode = `const scriptRel = ${scriptRel};const assetsURL = ${assetsURL};const seen = {};export const ${preloadMethod} = ${preload.toString()}` diff --git a/packages/vite/src/node/ssr/ssrStacktrace.ts b/packages/vite/src/node/ssr/ssrStacktrace.ts index 53e897d096b9cd..fe66b8803530b7 100644 --- a/packages/vite/src/node/ssr/ssrStacktrace.ts +++ b/packages/vite/src/node/ssr/ssrStacktrace.ts @@ -42,12 +42,12 @@ export function ssrRewriteStacktrace( return input } - const trimedVarName = varName.trim() + const trimmedVarName = varName.trim() const source = `${pos.source}:${pos.line}:${pos.column}` - if (!trimedVarName || trimedVarName === 'eval') { + if (!trimmedVarName || trimmedVarName === 'eval') { return ` at ${source}` } else { - return ` at ${trimedVarName} (${source})` + return ` at ${trimmedVarName} (${source})` } }, ) diff --git a/playground/optimize-deps/index.html b/playground/optimize-deps/index.html index 16f72b9a4899a2..2e24f421542fe7 100644 --- a/playground/optimize-deps/index.html +++ b/playground/optimize-deps/index.html @@ -103,8 +103,8 @@

Non Optimized Module isn't duplicated

// test dep detection in globbed files const globbed = import.meta.glob('./glob/*.js', { eager: true }) - import cjsBrowerFieldBare from '@vitejs/test-dep-cjs-browser-field-bare' - text('.cjs-browser-field-bare', cjsBrowerFieldBare) + import cjsBrowserFieldBare from '@vitejs/test-dep-cjs-browser-field-bare' + text('.cjs-browser-field-bare', cjsBrowserFieldBare) import { camelCase } from '@vitejs/test-dep-linked' text('.deps-linked', camelCase('foo-bar-baz')) diff --git a/playground/worker/worker/main-classic.js b/playground/worker/worker/main-classic.js index ed1c7392877190..a8d6552f438363 100644 --- a/playground/worker/worker/main-classic.js +++ b/playground/worker/worker/main-classic.js @@ -8,7 +8,7 @@ let classicWorker = new Worker( // test comment ) -// just test for case: ') ... ,' mean no worker options parmas +// just test for case: ') ... ,' mean no worker options params classicWorker = new Worker(new URL('../classic-worker.js', import.meta.url)) classicWorker.addEventListener('message', ({ data }) => {