File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable import/no-extraneous-dependencies */
2
+ import { join } from "path" ;
3
+
2
4
/* covered by nuxt */
5
+ import { move } from "fs-extra" ;
3
6
import _ from "lodash" ;
4
7
import { Utils } from "nuxt" ;
5
8
import chokidar from "chokidar" ;
@@ -166,6 +169,17 @@ export default function NetlifyCmsModule(moduleOptions) {
166
169
} )
167
170
} ) ;
168
171
}
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
+ } ) ;
169
183
}
170
184
171
185
// REQUIRED if publishing as an NPM package
You can’t perform that action at this time.
0 commit comments