File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ leaflet-geosearch.meijer.works
Original file line number Diff line number Diff line change 1
1
/* eslint-disable @typescript-eslint/no-var-requires */
2
2
const path = require ( 'path' ) ;
3
+ const fs = require ( 'fs' ) ;
4
+
5
+ const statics = [ 'CNAME' ] ;
6
+
7
+ const findRepoRoot = ( dir ) => {
8
+ const gitDir = path . join ( dir || process . cwd ( ) , '.git' ) ;
9
+
10
+ if ( fs . existsSync ( gitDir ) ) {
11
+ return dir ;
12
+ }
13
+
14
+ const parentDir = path . dirname ( dir ) ;
15
+ if ( parentDir === dir ) {
16
+ return null ;
17
+ }
18
+
19
+ return findRepoRoot ( parentDir ) ;
20
+ } ;
21
+
22
+ const root = findRepoRoot ( ) ;
23
+ const dist = path . join ( root , '.docz/dist' ) ;
24
+
25
+ exports . onPostBuild = ( { reporter } ) => {
26
+ for ( const file of statics ) {
27
+ const src = path . resolve ( root , file ) ;
28
+ const dest = path . resolve ( dist , file ) ;
29
+
30
+ if ( ! fs . existsSync ( src ) ) {
31
+ reporter . info ( `File ${ file } not found` ) ;
32
+ continue ;
33
+ }
34
+
35
+ fs . copyFileSync ( src , dest ) ;
36
+ reporter . info ( `Copied ${ src } → ${ dest } ` ) ;
37
+ }
38
+ } ;
3
39
4
40
exports . onCreateWebpackConfig = ( { actions, stage, loaders } ) => {
5
41
if ( stage === 'build-html' || stage === 'develop-html' ) {
You can’t perform that action at this time.
0 commit comments