mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
Fix resolve when using alias
This commit is contained in:
parent
b1546682ef
commit
d2c0f01593
@ -15,7 +15,13 @@ const remove = pify(fs.remove)
|
||||
const readFile = pify(fs.readFile)
|
||||
const writeFile = pify(fs.writeFile)
|
||||
const mkdirp = pify(fs.mkdirp)
|
||||
const r = resolve
|
||||
const r = function () {
|
||||
const args = Array.from(arguments)
|
||||
if (_.last(args).includes('~')) {
|
||||
return _.last(args)
|
||||
}
|
||||
return resolve.apply(null, arguments)
|
||||
}
|
||||
|
||||
const defaults = {
|
||||
filenames: {
|
||||
@ -100,10 +106,7 @@ module.exports = function * () {
|
||||
if (route.component.slice(-4) !== '.vue') {
|
||||
route.component = route.component + '.vue'
|
||||
}
|
||||
// If not using an alias
|
||||
if (route.component.indexOf('~') === -1) {
|
||||
route.component = r(this.dir, route.component)
|
||||
}
|
||||
route.component = r(this.dir, route.component)
|
||||
})
|
||||
// Generate routes and interpret the template files
|
||||
yield generateRoutesAndFiles.call(this)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nuxt",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.2",
|
||||
"description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
|
Loading…
Reference in New Issue
Block a user