Skip to content

Commit fe3e4f9

Browse files
committed
chore: fix generate mode admin folder move paths, replace by copy
1 parent 044dbf4 commit fe3e4f9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/module.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable import/no-extraneous-dependencies */
2-
import { join } from "path";
2+
import { resolve, join } from "path";
33

44
/* covered by nuxt */
5-
import { move } from "fs-extra";
5+
import { copy } from "fs-extra";
66
import _ from "lodash";
77
import { r, urlJoin } from "@nuxt/common";
88
import chokidar from "chokidar";
@@ -195,10 +195,13 @@ export default function NetlifyCmsModule(moduleOptions) {
195195
}
196196

197197
// Move cms folder from `dist/_nuxt` folder to `dist/` after nuxt generate
198-
this.nuxt.hook("generate:distCopied", async generator => {
199-
await move(
200-
join(generator.distNuxtPath, config.adminPath).replace(/\/$/, ""),
201-
join(generator.distPath, config.adminPath).replace(/\/$/, "")
198+
this.nuxt.hook("generate:distCopied", async nuxt => {
199+
await copy(
200+
resolve(nuxt.options.buildDir, "dist", config.adminPath).replace(
201+
/\/$/,
202+
""
203+
),
204+
join(nuxt.distPath, config.adminPath).replace(/\/$/, "")
202205
);
203206
debug("Netlify CMS files copied");
204207
});

0 commit comments

Comments
 (0)