File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable import/no-extraneous-dependencies */
2+ import { join } from "path" ;
3+
24/* covered by nuxt */
5+ import { move } from "fs-extra" ;
36import _ from "lodash" ;
47import { Utils } from "nuxt" ;
58import chokidar from "chokidar" ;
@@ -166,6 +169,17 @@ export default function NetlifyCmsModule(moduleOptions) {
166169 } )
167170 } ) ;
168171 }
172+
173+ // Move cms folder from `dist/_nuxt` folder to `dist/` after nuxt generate
174+ this . nuxt . plugin ( "generator" , generator => {
175+ generator . plugin ( "generate" , async ( ) => {
176+ await move (
177+ join ( generator . distNuxtPath , config . adminPath ) . replace ( / \/ $ / , "" ) ,
178+ join ( generator . distPath , config . adminPath ) . replace ( / \/ $ / , "" )
179+ ) ;
180+ debug ( "Netlify CMS files copied" ) ;
181+ } ) ;
182+ } ) ;
169183}
170184
171185// REQUIRED if publishing as an NPM package
You can’t perform that action at this time.
0 commit comments