chore: typo

pull/188/head
Anthony Fu 4 years ago
parent 309aa7a8d0
commit 5fc2ee09cd

@ -43,7 +43,7 @@ export async function build(buildOptions: BuildOptions = {}) {
// alter the main chunk's hash on every build. It's also embedded as a // alter the main chunk's hash on every build. It's also embedded as a
// string and JSON.parsed from the client because it's faster than embedding // string and JSON.parsed from the client because it's faster than embedding
// as JS object literal. // as JS object literal.
const hashMapStirng = JSON.stringify(JSON.stringify(pageToHashMap)) const hashMapString = JSON.stringify(JSON.stringify(pageToHashMap))
for (const page of siteConfig.pages) { for (const page of siteConfig.pages) {
await renderPage( await renderPage(
@ -53,7 +53,7 @@ export async function build(buildOptions: BuildOptions = {}) {
appChunk, appChunk,
cssChunk, cssChunk,
pageToHashMap, pageToHashMap,
hashMapStirng hashMapString
) )
} }
} catch (e) { } catch (e) {

@ -104,7 +104,7 @@ export async function bundle(
fileName: chunk.fileName.replace(/\.js$/, '.lean.js'), fileName: chunk.fileName.replace(/\.js$/, '.lean.js'),
code: chunk.code.replace(staticStripRE, ``) code: chunk.code.replace(staticStripRE, ``)
} }
// remove static markers from orginal code // remove static markers from original code
chunk.code = chunk.code.replace(staticRestoreRE, '') chunk.code = chunk.code.replace(staticRestoreRE, '')
} }
} }
@ -145,7 +145,7 @@ export async function bundle(
}, },
rollupOutputOptions: { rollupOutputOptions: {
...rollupOutputOptions, ...rollupOutputOptions,
chunkFileNames: (chunk) => { chunkFileNames(chunk): string {
if (/runtime-dom/.test(chunk.name)) { if (/runtime-dom/.test(chunk.name)) {
return `framework.[hash].js` return `framework.[hash].js`
} }

@ -14,7 +14,7 @@ export async function renderPage(
appChunk: OutputChunk, appChunk: OutputChunk,
cssChunk: OutputAsset, cssChunk: OutputAsset,
pageToHashMap: Record<string, string>, pageToHashMap: Record<string, string>,
hashMapStirng: string hashMapString: string
) { ) {
const { createApp } = require(path.join(config.tempDir, `_assets/app.js`)) const { createApp } = require(path.join(config.tempDir, `_assets/app.js`))
const { app, router } = createApp() const { app, router } = createApp()
@ -71,7 +71,7 @@ export async function renderPage(
</head> </head>
<body> <body>
<div id="app">${content}</div> <div id="app">${content}</div>
<script>__VP_HASH_MAP__ = JSON.parse(${hashMapStirng})</script> <script>__VP_HASH_MAP__ = JSON.parse(${hashMapString})</script>
<script type="module" async src="${assetPath}${appChunk.fileName}"></script> <script type="module" async src="${assetPath}${appChunk.fileName}"></script>
</body> </body>
</html>`.trim() </html>`.trim()

@ -37,7 +37,7 @@ export const highlight = (str: string, lang: string) => {
} catch (e) { } catch (e) {
console.warn( console.warn(
chalk.yellow( chalk.yellow(
`[vuepress] Syntax highlight for language "${lang}" is not supported.` `[vitepress] Syntax highlight for language "${lang}" is not supported.`
) )
) )
} }

@ -12,7 +12,7 @@ export const slugify = (str: string): string => {
.replace(rControl, '') .replace(rControl, '')
// Replace special characters // Replace special characters
.replace(rSpecial, '-') .replace(rSpecial, '-')
// Remove continous separators // Remove continuos separators
.replace(/\-{2,}/g, '-') .replace(/\-{2,}/g, '-')
// Remove prefixing and trailing separtors // Remove prefixing and trailing separtors
.replace(/^\-+|\-+$/g, '') .replace(/^\-+|\-+$/g, '')

@ -10,7 +10,7 @@ export const DEFAULT_THEME_PATH = path.join(
) )
// special virtual file // special virtual file
// we can't directly import '/@siteData' becase // we can't directly import '/@siteData' because
// - it's not an actual file so we can't use tsconfig paths to redirect it // - it's not an actual file so we can't use tsconfig paths to redirect it
// - TS doesn't allow shimming a module that starts with '/' // - TS doesn't allow shimming a module that starts with '/'
export const SITE_DATA_ID = '@siteData' export const SITE_DATA_ID = '@siteData'

@ -5,7 +5,7 @@
// //
// But header's parsing in the markdown content is done by the markdown // But header's parsing in the markdown content is done by the markdown
// loader based on markdown-it. markdown-it parser will will always keep // loader based on markdown-it. markdown-it parser will will always keep
// HTML in headers, so in VuePress, after being parsed by the markdiwn // HTML in headers, so in VuePress, after being parsed by the markdown
// loader, the raw HTML in headers will finally be parsed by Vue-loader. // loader, the raw HTML in headers will finally be parsed by Vue-loader.
// so that we can write HTML/Vue in the header. One exception is the HTML // so that we can write HTML/Vue in the header. One exception is the HTML
// wrapped by <code>(markdown token: '`') tag. // wrapped by <code>(markdown token: '`') tag.

Loading…
Cancel
Save