Skip to content

Commit

Permalink
add storybook-gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jan 7, 2019
1 parent ed56f4a commit 1cd7dee
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion lib/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,8 +975,36 @@ gulp.task('storybook-build', () => {

storybook({
mode: 'static',
// 相对路径,storybook会自动拼接 cmd 所在的位置
// 相对路径,storybook 会自动拼接 cmd 所在的位置
outputDir: './build',
configDir: path.join(__dirname, './storybook/'),
});
});

gulp.task(
'storybook-gh-pages',
gulp.series(done => {
console.log('gh-paging');
if (pkg.scripts['pre-gh-pages']) {
shelljs.exec('npm run pre-gh-pages');
}
if (fs.existsSync(resolveCwd('./build/'))) {
const ghPages = require('gh-pages');
ghPages.publish(
resolveCwd('build'),
{
logger(message) {
console.log(message);
},
},
() => {
cleanBuild();
console.log('gh-paged');
done();
}
);
} else {
done();
}
})
);

0 comments on commit 1cd7dee

Please sign in to comment.