add site iframe support

pull/9/merge
tangjinzhou 7 years ago
parent 7fa005dbe6
commit ad6374236f

@ -56,15 +56,17 @@ function copyHtml () {
rl.on('line', (line) => { rl.on('line', (line) => {
const name = line.split('antd/')[1].split('/')[0] const name = line.split('antd/')[1].split('/')[0]
console.log('create path:', name) console.log('create path:', name)
const toPath1 = `site-dist/components/${name}` const toPaths = [
const toPath2 = `site-dist/components/${name}-cn` `site-dist/components/${name}`,
rimraf.sync(path.join(cwd, toPath1)) `site-dist/components/${name}-cn`,
rimraf.sync(path.join(cwd, toPath2)) `site-dist/iframe/${name}`,
mkdirp(path.join(cwd, toPath1), function () { `site-dist/iframe/${name}-cn`,
fs.writeFileSync(path.join(cwd, `${toPath1}/index.html`), fs.readFileSync(path.join(cwd, 'site-dist/index.html'))) ]
toPaths.forEach(toPath => {
rimraf.sync(path.join(cwd, toPath))
mkdirp(path.join(cwd, toPath), function () {
fs.writeFileSync(path.join(cwd, `${toPath}/index.html`), fs.readFileSync(path.join(cwd, 'site-dist/index.html')))
}) })
mkdirp(path.join(cwd, toPath2), function () {
fs.writeFileSync(path.join(cwd, `${toPath2}/index.html`), fs.readFileSync(path.join(cwd, 'site-dist/index.html')))
}) })
}) })
const source = [ const source = [

Loading…
Cancel
Save