Skip to content

Commit

Permalink
chore: typos (#1463) [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenzhenChange committed Jan 10, 2021
1 parent 1e13c0a commit 91dbb01
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default ({ command, mode }) => {
- **Type:** `string`
- **Default:** `'development'` for serve, `'production'` for build

Specifying this in config will override the default mode for both serve and build. This value can also be overriden via the command line `--mode` option.
Specifying this in config will override the default mode for both serve and build. This value can also be overridden via the command line `--mode` option.

See [Env Variables and Modes](/guide/env-and-mode) for more details.

Expand Down Expand Up @@ -192,7 +192,7 @@ export default ({ command, mode }) => {

- **Type:** `string[]`

If you have duplicated copies of the same depdendency in your app (likely due to hoisting or linked packages in monorepos), use this option to force Vite to always resolve listed dependencies to the same copy (from
If you have duplicated copies of the same dependency in your app (likely due to hoisting or linked packages in monorepos), use this option to force Vite to always resolve listed dependencies to the same copy (from
project root).

### logLevel
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/api-hmr.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:::tip Note
This is the client HMR API. For handling HMR update in plugins, see [handleHotUpdate](./api-plugin#handlehotupdate).

The manual HMR API is primarly intended for framework and tooling authors. As an end user, HMR is likely already handled for you in the framework specific starter templates.
The manual HMR API is primarily intended for framework and tooling authors. As an end user, HMR is likely already handled for you in the framework specific starter templates.
:::

Vite exposes its manual HMR API via the special `import.meta.hot` object:
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/api-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const { createServer } = require('vite')
The `InlineConfig` interface extends `UserConfig` with additional properties:

- `mode`: override default mode (`'development'` for server)
- `configFile`: specifcy config file to use. If not set, Vite will try to automatically resolve one from project root. Set to `false` to disable auto resolving.
- `configFile`: specify config file to use. If not set, Vite will try to automatically resolve one from project root. Set to `false` to disable auto resolving.

## `ViteDevServer`

Expand Down Expand Up @@ -72,12 +72,12 @@ interface ViteDevServer {
*/
moduleGraph: ModuleGraph
/**
* Programatically resolve, load and transform a URL and get the result
* Programmatically resolve, load and transform a URL and get the result
* without going through the http request pipeline.
*/
transformRequest(url: string): Promise<TransformResult | null>
/**
* Util for transfoming a file with esbuild.
* Util for transforming a file with esbuild.
* Can be useful for certain plugins.
*/
transformWithEsbuild(
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/api-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo
**Example:**

```js
const exmaplePlugin = () => {
const examplePlugin = () => {
let config

return {
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
`server`.

- `hostname` is now [`server.host`](/config/#server-host).
- `httpsOptions` has been removed. [`server.https`](/config/#server-https) can diretly accept the options object.
- `httpsOptions` has been removed. [`server.https`](/config/#server-https) can directly accept the options object.
- `chokidarWatchOptions` is now [`server.watch`](/config/#server-watch).

- [`assetsInclude`](/config/#assetsInclude) now expects `string | RegExp | (string | RegExp)[]` instead of a function.
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue-jsx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { defineComponent } from 'vue'
// named exports w/ variable declaration: ok
export const Foo = defineComponent(...)

// named exports referencing vairable declaration: ok
// named exports referencing variable declaration: ok
const Bar = defineComponent(...)
export { Bar }

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/handleHotUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export async function handleHotUpdate({
// custom blocks update causes a reload
// because the custom block contents is changed and it may be used in JS.
if (prevCustoms.length !== nextCustoms.length) {
// block rmeoved/added, force reload
// block removed/added, force reload
affectedModules.add(mainModule)
} else {
for (let i = 0; i < nextCustoms.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async function handleMessage(payload: HMRPayload) {
queueUpdate(fetchUpdate(update))
} else {
// css-update
// this is only sent when a css file referened with <link> is updated
// this is only sent when a css file referenced with <link> is updated
let { path, timestamp } = update
path = path.replace(/\?.*/, '')
const el = document.querySelector(`link[href*='${path}']`)
Expand Down Expand Up @@ -261,7 +261,7 @@ export function removeStyle(id: string) {
async function fetchUpdate({ path, acceptedPath, timestamp }: Update) {
const mod = hotModulesMap.get(path)
if (!mod) {
// In a code-spliting project,
// In a code-splitting project,
// it is common that the hot-updating module is not loaded yet.
// https://github.com/vitejs/vite/issues/721
return
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface DepOptimizationOptions {
*/
link?: string[]
/**
* A list of depdendencies that imports Node built-ins, but do not actually
* A list of dependencies that imports Node built-ins, but do not actually
* use them in browsers.
*/
allowNodeBuiltins?: string[]
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function fileToDevUrl(id: string, { root }: ResolvedConfig) {
return '/' + path.posix.relative(root, id)
}
// outside of project root, use absolute fs path
// (this is speical handled by the serve static middleware
// (this is special handled by the serve static middleware
return FS_PREFIX + id
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/dynamicImportPolyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ResolvedConfig } from '..'
import { Plugin } from '../plugin'

export const polyfillId = 'vite/dynamic-import-polyfill'
const polyfillPlaceholder = `__DYANMIC_IMPORT_POLYFILL__()`
const polyfillPlaceholder = `__DYNAMIC_IMPORT_POLYFILL__()`

export function dynamicImportPolyfillPlugin(config: ResolvedConfig): Plugin {
const skip = config.command === 'serve' || config.build.ssr
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function markExplicitImport(url: string) {
* ```
*
* - CSS imports are appended with `.js` since both the js module and the actual
* css (referenced via <link>) may go through the trasnform pipeline:
* css (referenced via <link>) may go through the transform pipeline:
*
* ```js
* import './style.css'
Expand Down Expand Up @@ -464,7 +464,7 @@ type ImportNameSpecifier = { importedName: string; localName: string }
* Detect import statements to a known optimized CJS dependency and provide
* ES named imports interop. We do this by rewriting named imports to a variable
* assignment to the corresponding property on the `module.exports` of the cjs
* module. Note this doesn't support dynamic re-assisgnments from within the cjs
* module. Note this doesn't support dynamic re-assignments from within the cjs
* module.
*
* Note that es-module-lexer treats `export * from '...'` as an import as well,
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ export function resolvePlugin({
// handle browser field mapping for relative imports
const pkg = importer && idToPkgMap.get(importer)
if (pkg && isObject(pkg.data.browser)) {
const pkgRealtivePath = './' + slash(path.relative(pkg.dir, fsPath))
const pkgRelativePath = './' + slash(path.relative(pkg.dir, fsPath))
const browserMappedPath = mapWithBrowserField(
pkgRealtivePath,
pkgRelativePath,
pkg.data.browser
)
if (browserMappedPath) {
Expand Down
6 changes: 3 additions & 3 deletions packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ export interface ViteDevServer {
*/
moduleGraph: ModuleGraph
/**
* Programatically resolve, load and transform a URL and get the result
* Programmatically resolve, load and transform a URL and get the result
* without going through the http request pipeline.
*/
transformRequest(url: string): Promise<TransformResult | null>
/**
* Util for transfoming a file with esbuild.
* Util for transforming a file with esbuild.
* Can be useful for certain plugins.
*/
transformWithEsbuild(
Expand All @@ -179,7 +179,7 @@ export interface ViteDevServer {
*/
close(): Promise<void>
/**
* @intenral
* @internal
*/
optimizeDepsMetadata: DepOptimizationMetadata | null
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/middlewares/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function proxyMiddleware({
if (opts.configure) {
opts.configure(proxy, opts)
}
// clone before saving becaues http-proxy mutates the options
// clone before saving because http-proxy mutates the options
proxies[context] = [proxy, { ...opts }]
})

Expand Down
22 changes: 11 additions & 11 deletions packages/vite/src/node/server/moduleGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ export class ModuleGraph {
mod.id = resolvedId
this.idToModuleMap.set(resolvedId, mod)
const file = (mod.file = cleanUrl(resolvedId))
let fileMappedMdoules = this.fileToModulesMap.get(file)
if (!fileMappedMdoules) {
fileMappedMdoules = new Set()
this.fileToModulesMap.set(file, fileMappedMdoules)
let fileMappedModules = this.fileToModulesMap.get(file)
if (!fileMappedModules) {
fileMappedModules = new Set()
this.fileToModulesMap.set(file, fileMappedModules)
}
fileMappedMdoules.add(mod)
fileMappedModules.add(mod)
}
return mod
}
Expand All @@ -139,19 +139,19 @@ export class ModuleGraph {
createFileOnlyEntry(file: string) {
file = normalizePath(file)
const url = `/@fs/${file}`
let fileMappedMdoules = this.fileToModulesMap.get(file)
if (!fileMappedMdoules) {
fileMappedMdoules = new Set()
this.fileToModulesMap.set(file, fileMappedMdoules)
let fileMappedModules = this.fileToModulesMap.get(file)
if (!fileMappedModules) {
fileMappedModules = new Set()
this.fileToModulesMap.set(file, fileMappedModules)
}
for (const m of fileMappedMdoules) {
for (const m of fileMappedModules) {
if (m.url === url) {
return m
}
}
const mod = new ModuleNode(url)
mod.file = file
fileMappedMdoules.add(mod)
fileMappedModules.add(mod)
return mod
}

Expand Down

0 comments on commit 91dbb01

Please sign in to comment.