From 4db7e432df6e0980f4f6324d374491323801c0c1 Mon Sep 17 00:00:00 2001 From: lihbr <25330882+lihbr@users.noreply.github.com> Date: Tue, 28 Jul 2020 14:38:06 +0200 Subject: [PATCH] fix(cli): normalize win32 paths for `nuxt generate` cache snapshots (#7796) Co-authored-by: lihbr --- packages/cli/package.json | 1 + packages/cli/src/utils/generate.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 4ce47990e9..483f1c075e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -33,6 +33,7 @@ "pretty-bytes": "^5.3.0", "serve-static": "^1.14.1", "std-env": "^2.2.1", + "upath": "^1.2.0", "wrap-ansi": "^6.2.0" }, "publishConfig": { diff --git a/packages/cli/src/utils/generate.js b/packages/cli/src/utils/generate.js index 6e881972b2..c1c7eed18e 100644 --- a/packages/cli/src/utils/generate.js +++ b/packages/cli/src/utils/generate.js @@ -1,4 +1,5 @@ import path, { relative } from 'path' +import upath from 'upath' import fs from 'fs-extra' import crc32 from 'crc/lib/crc32' import consola from 'consola' @@ -48,7 +49,7 @@ export async function ensureBuild (cmd) { // Take a snapshot of current project const snapshotOptions = { rootDir: nuxt.options.rootDir, - ignore: nuxt.options.generate.cache.ignore, + ignore: nuxt.options.generate.cache.ignore.map(upath.normalize), globbyOptions: nuxt.options.generate.cache.globbyOptions }