Skip to content

Commit 9340794

Browse files
committed
add site iframe support
1 parent 8d43e4a commit 9340794

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

scripts/gulpfile.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,17 @@ function copyHtml () {
5656
rl.on('line', (line) => {
5757
const name = line.split('antd/')[1].split('/')[0]
5858
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+
})
6870
})
6971
})
7072
const source = [

0 commit comments

Comments
 (0)