@@ -56,15 +56,17 @@ function copyHtml () {
56
56
rl . on ( 'line' , ( line ) => {
57
57
const name = line . split ( 'antd/' ) [ 1 ] . split ( '/' ) [ 0 ]
58
58
console . log ( 'create path:' , name )
59
- const toPath1 = `site-dist/components/${ name } `
60
- const toPath2 = `site-dist/components/${ name } -cn`
61
- rimraf . sync ( path . join ( cwd , toPath1 ) )
62
- rimraf . sync ( path . join ( cwd , toPath2 ) )
63
- mkdirp ( path . join ( cwd , toPath1 ) , function ( ) {
64
- fs . writeFileSync ( path . join ( cwd , `${ toPath1 } /index.html` ) , fs . readFileSync ( path . join ( cwd , 'site-dist/index.html' ) ) )
65
- } )
66
- mkdirp ( path . join ( cwd , toPath2 ) , function ( ) {
67
- fs . writeFileSync ( path . join ( cwd , `${ toPath2 } /index.html` ) , fs . readFileSync ( path . join ( cwd , 'site-dist/index.html' ) ) )
59
+ const toPaths = [
60
+ `site-dist/components/${ name } ` ,
61
+ `site-dist/components/${ name } -cn` ,
62
+ `site-dist/iframe/${ name } ` ,
63
+ `site-dist/iframe/${ name } -cn` ,
64
+ ]
65
+ toPaths . forEach ( toPath => {
66
+ rimraf . sync ( path . join ( cwd , toPath ) )
67
+ mkdirp ( path . join ( cwd , toPath ) , function ( ) {
68
+ fs . writeFileSync ( path . join ( cwd , `${ toPath } /index.html` ) , fs . readFileSync ( path . join ( cwd , 'site-dist/index.html' ) ) )
69
+ } )
68
70
} )
69
71
} )
70
72
const source = [
0 commit comments