Skip to content

Commit

Permalink
chore: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Tal500 committed Sep 10, 2022
1 parent 6923be3 commit 94908e1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Vitest Snapshot v1

exports[`analyzeSystemRegisteration > hello 1`] = `undefined`;
exports[`analyzeSystemRegistration > hello 1`] = `undefined`;

exports[`analyzeSystemRegisteration > minified 1`] = `
exports[`analyzeSystemRegistration > minified 1`] = `
{
"chunkListCode": "[\\"./chunks/index-legacy-60db70ad.js\\",\\"./chunks/singletons-legacy-a9d19225.js\\"]",
"exportParam": "n",
Expand All @@ -11,7 +11,7 @@ exports[`analyzeSystemRegisteration > minified 1`] = `
}
`;

exports[`analyzeSystemRegisteration > svelte-legacy-part 1`] = `
exports[`analyzeSystemRegistration > svelte-legacy-part 1`] = `
{
"chunkListCode": "['./chunks/index-legacy-60db70ad.js', './chunks/singletons-legacy-4fba2acb.js']",
"exportParam": "exports",
Expand All @@ -20,7 +20,7 @@ exports[`analyzeSystemRegisteration > svelte-legacy-part 1`] = `
}
`;

exports[`analyzeSystemRegisteration > vue-legacy-part 1`] = `
exports[`analyzeSystemRegistration > vue-legacy-part 1`] = `
{
"chunkListCode": "[]",
"exportParam": "exports",
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/src/node/__tests__/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { describe, expect, test } from 'vitest'
import {
analyzeSystemRegisteration,
analyzeSystemRegistration,
asyncFlatten,
getHash,
getLocalhostAddressIfDiffersFromDNS,
Expand Down Expand Up @@ -197,11 +197,11 @@ describe('asyncFlatten', () => {
})
})

describe('analyzeSystemRegisteration', () => {
describe('analyzeSystemRegistration', () => {
system_format_snippets.forEach((snippet) => {
test(snippet, () => {
expect(
analyzeSystemRegisteration(readInputFile(`${snippet}.js`))
analyzeSystemRegistration(readInputFile(`${snippet}.js`))
).toMatchSnapshot()
})
})
Expand Down
5 changes: 2 additions & 3 deletions packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { CLIENT_PUBLIC_PATH, SPECIAL_QUERY_RE } from '../constants'
import type { ResolvedConfig } from '../config'
import type { Plugin } from '../plugin'
import {
analyzeSystemRegisteration,
analyzeSystemRegistration,
asyncReplace,
cleanUrl,
combineSourcemaps,
Expand Down Expand Up @@ -588,8 +588,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
)
case 'system':
return (code: string) => {
const moduleParam =
analyzeSystemRegisteration(code)?.moduleParam
const moduleParam = analyzeSystemRegistration(code)?.moduleParam
return moduleParam !== undefined
? new RegExp(
`\\b${moduleParam}.import\\s*["'][^"']*(?:${emptyChunkFiles})["'];\n?`,
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/importAnalysisBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { OutputChunk, SourceMap } from 'rollup'
import colors from 'picocolors'
import type { RawSourceMap } from '@ampproject/remapping'
import {
analyzeSystemRegisteration,
analyzeSystemRegistration,
bareImportRE,
cleanUrl,
combineSourcemaps,
Expand Down Expand Up @@ -580,7 +580,7 @@ export function buildImportAnalysisPlugin(config: ResolvedConfig): Plugin {
export function parseImportsSystemJS(
code: string
): ReadonlyArray<ImportSpecifier> {
const moduleParam = analyzeSystemRegisteration(code)?.moduleParam
const moduleParam = analyzeSystemRegistration(code)?.moduleParam

const re =
/\((.+?(?<importDirective>\b\w+\.import\s*(?<parenthesesStart>\()\s*('(?<path1>.+?)'|"(?<path2>.+?)")\);?).*?),\s*"__VITE_PRELOAD__".*?\)/gs
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ export const isNonDriveRelativeAbsolutePath = (p: string): boolean => {
/**
* Analyze the SystemJS module registration `System.register` in the code.
*/
export function analyzeSystemRegisteration(code: string):
export function analyzeSystemRegistration(code: string):
| {
chunkListCode: string
paramsCode: string
Expand Down

0 comments on commit 94908e1

Please sign in to comment.