mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
misc: fix typos
This commit is contained in:
parent
c3e51a05af
commit
e2296061b0
@ -258,12 +258,12 @@ export const createRoutes = function createRoutes(files, srcDir, pagesDir) {
|
||||
let parent = routes
|
||||
keys.forEach((key, i) => {
|
||||
// remove underscore only, if its the prefix
|
||||
const sanatizedKey = key.indexOf('_') === 0
|
||||
const sanitizedKey = key.indexOf('_') === 0
|
||||
? key.replace('_', '')
|
||||
: key
|
||||
route.name = route.name
|
||||
? route.name + '-' + sanatizedKey
|
||||
: sanatizedKey
|
||||
? route.name + '-' + sanitizedKey
|
||||
: sanitizedKey
|
||||
route.name += key === '_' ? 'all' : ''
|
||||
route.chunkName = file.replace(/\.(vue|js)$/, '')
|
||||
let child = _.find(parent, { name: route.name })
|
||||
|
@ -22,7 +22,7 @@ export default class ModuleContainer {
|
||||
}
|
||||
|
||||
addVendor(vendor) {
|
||||
// Make it silent for backward compability with nuxt 1.x
|
||||
// Make it silent for backward compatibility with nuxt 1.x
|
||||
}
|
||||
|
||||
addTemplate(template) {
|
||||
@ -112,7 +112,9 @@ export default class ModuleContainer {
|
||||
|
||||
// Resolve handler
|
||||
if (!handler) {
|
||||
handler = this.nuxt.requireModule(src, { esm: false })
|
||||
// If module is internal (src starts with '.' or alias '@' '~'), support esm
|
||||
const isInnerModule = /^[.@~]/.test(src)
|
||||
handler = this.nuxt.requireModule(src, { esm: isInnerModule })
|
||||
}
|
||||
|
||||
// Validate handler
|
||||
|
@ -199,8 +199,8 @@ export default class Nuxt {
|
||||
}
|
||||
|
||||
requireModule(_path, opts = {}) {
|
||||
const _resovledPath = this.resolvePath(_path)
|
||||
const m = opts.esm === false ? require(_resovledPath) : this.esm(_resovledPath)
|
||||
const _resolvedPath = this.resolvePath(_path)
|
||||
const m = opts.esm === false ? require(_resolvedPath) : this.esm(_resolvedPath)
|
||||
return (m && m.default) || m
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user