@@ -12,7 +12,7 @@ const mkdirp = require('mkdirp');
12
12
const cwd = process . cwd ( ) ;
13
13
14
14
function dist ( done ) {
15
- rimraf . sync ( path . join ( cwd , 'site-dist ' ) ) ;
15
+ rimraf . sync ( path . join ( cwd , '_site ' ) ) ;
16
16
process . env . RUN_ENV = 'PRODUCTION' ;
17
17
const webpackConfig = require ( path . join ( cwd , 'webpack.site.config.js' ) ) ;
18
18
webpack ( webpackConfig , ( err , stats ) => {
@@ -53,30 +53,30 @@ function copyHtml() {
53
53
input : fs . createReadStream ( path . join ( cwd , 'site/demoRoutes.js' ) ) ,
54
54
} ) ;
55
55
fs . writeFileSync (
56
- path . join ( cwd , 'site-dist /404.html' ) ,
56
+ path . join ( cwd , '_site /404.html' ) ,
57
57
fs . readFileSync ( path . join ( cwd , 'site/404.html' ) ) ,
58
58
) ;
59
59
fs . writeFileSync (
60
- path . join ( cwd , 'site-dist /index-cn.html' ) ,
61
- fs . readFileSync ( path . join ( cwd , 'site-dist /index.html' ) ) ,
60
+ path . join ( cwd , '_site /index-cn.html' ) ,
61
+ fs . readFileSync ( path . join ( cwd , '_site /index.html' ) ) ,
62
62
) ;
63
- fs . writeFileSync ( path . join ( cwd , 'site-dist /CNAME' ) , 'vue.ant.design' ) ;
63
+ fs . writeFileSync ( path . join ( cwd , '_site /CNAME' ) , 'vue.ant.design' ) ;
64
64
rl . on ( 'line' , line => {
65
65
if ( line . indexOf ( 'path:' ) > - 1 ) {
66
66
const name = line . split ( "'" ) [ 1 ] . split ( "'" ) [ 0 ] ;
67
67
console . log ( 'create path:' , name ) ;
68
68
const toPaths = [
69
- `site-dist /components/${ name } ` ,
70
- // `site-dist /components/${name}-cn`,
71
- `site-dist /iframe/${ name } ` ,
72
- // `site-dist /iframe/${name}-cn`,
69
+ `_site /components/${ name } ` ,
70
+ // `_site /components/${name}-cn`,
71
+ `_site /iframe/${ name } ` ,
72
+ // `_site /iframe/${name}-cn`,
73
73
] ;
74
74
toPaths . forEach ( toPath => {
75
75
rimraf . sync ( path . join ( cwd , toPath ) ) ;
76
76
mkdirp ( path . join ( cwd , toPath ) , function ( ) {
77
77
fs . writeFileSync (
78
78
path . join ( cwd , `${ toPath } /index.html` ) ,
79
- fs . readFileSync ( path . join ( cwd , 'site-dist /index.html' ) ) ,
79
+ fs . readFileSync ( path . join ( cwd , '_site /index.html' ) ) ,
80
80
) ;
81
81
} ) ;
82
82
} ) ;
@@ -92,16 +92,16 @@ function copyHtml() {
92
92
const paths = file . path . split ( '/' ) ;
93
93
const name = paths [ paths . length - 1 ] . split ( '.' ) [ 0 ] . toLowerCase ( ) ;
94
94
const toPaths = [
95
- 'site-dist /docs' ,
96
- 'site-dist /docs/vue' ,
97
- `site-dist /docs/vue/${ name } ` ,
98
- `site-dist /docs/vue/${ name } -cn` ,
95
+ '_site /docs' ,
96
+ '_site /docs/vue' ,
97
+ `_site /docs/vue/${ name } ` ,
98
+ `_site /docs/vue/${ name } -cn` ,
99
99
] ;
100
100
toPaths . forEach ( toPath => {
101
101
mkdirp ( path . join ( cwd , toPath ) , function ( ) {
102
102
fs . writeFileSync (
103
103
path . join ( cwd , `${ toPath } /index.html` ) ,
104
- fs . readFileSync ( path . join ( cwd , 'site-dist /index.html' ) ) ,
104
+ fs . readFileSync ( path . join ( cwd , '_site /index.html' ) ) ,
105
105
) ;
106
106
} ) ;
107
107
} ) ;
@@ -110,7 +110,7 @@ function copyHtml() {
110
110
) ;
111
111
}
112
112
113
- gulp . task ( 'site-dist ' , done => {
113
+ gulp . task ( '_site ' , done => {
114
114
dist ( ( ) => {
115
115
copyHtml ( ) ;
116
116
} ) ;
0 commit comments