diff --git a/lib/build/index.js b/lib/build/index.js index e8bd9d369d..af149438dc 100644 --- a/lib/build/index.js +++ b/lib/build/index.js @@ -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) diff --git a/package.json b/package.json index dcc9fecf01..3703a3623f 100644 --- a/package.json +++ b/package.json @@ -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",