Fix path on windows

This commit is contained in:
Sébastien Chopin 2016-11-20 11:37:53 +01:00
parent fa68b8b383
commit 8cbbaeaf83
2 changed files with 19 additions and 9 deletions

View File

@ -10,17 +10,27 @@ const hash = require('hash-sum')
const pify = require('pify')
const webpack = require('webpack')
const { createBundleRenderer } = require('vue-server-renderer')
const { join, resolve } = require('path')
const { join, resolve, sep } = require('path')
const remove = pify(fs.remove)
const readFile = pify(fs.readFile)
const writeFile = pify(fs.writeFile)
const mkdirp = pify(fs.mkdirp)
const r = function () {
const args = Array.from(arguments)
if (_.last(args).includes('~')) {
return _.last(args)
const reqSep = /\//g
const sysSep = _.escapeRegExp(sep)
const normalize = string => string.replace(reqSep, sysSep)
const wp = function (p) {
if (/^win/.test(process.platform)) {
p = p.replace(/\\/g, '\\\\')
}
return resolve.apply(null, arguments)
return p
}
const r = function () {
let args = Array.from(arguments)
args = args.map(normalize)
if (_.last(args).includes('~')) {
return wp(_.last(args))
}
return wp(resolve.apply(null, args))
}
const defaults = {

View File

@ -1,6 +1,6 @@
{
"name": "nuxt",
"version": "0.5.0",
"version": "0.5.1",
"description": "A minimalistic framework for server-rendered Vue.js applications (inspired by Next.js)",
"main": "index.js",
"license": "MIT",
@ -41,11 +41,11 @@
"serialize-javascript": "^1.3.0",
"serve-static": "^1.11.1",
"url-loader": "^0.5.7",
"vue": "^2.0.7",
"vue": "^2.0.8",
"vue-loader": "^9.9.5",
"vue-meta": "^0.4.4",
"vue-router": "^2.0.3",
"vue-server-renderer": "^2.0.7",
"vue-server-renderer": "^2.0.8",
"vuex": "^2.0.0",
"webpack": "2.1.0-beta.26",
"webpack-dev-middleware": "^1.8.4",