forked from redux-orm/redux-orm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
24 lines (22 loc) · 764 Bytes
/
gulpfile.js
File metadata and controls
24 lines (22 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const gulp = require('gulp');
const ghPages = require('gulp-gh-pages');
const rename = require('gulp-rename');
gulp.task('deploy', () =>
gulp.src([
'./dist/**/*',
'./docs/**/*',
], { base: '.' })
.pipe(rename(filepath => {
if (filepath.dirname.startsWith('docs')) {
// Collapses `docs` parent directory
// so index.html ends up at the root.
// `dist` remains in the dist folder.
const withoutDocs = filepath.dirname.substring('docs'.length);
const withoutLeadingSlash = withoutDocs.startsWith('/')
? withoutDocs.substring(1)
: withoutDocs;
filepath.dirname = withoutLeadingSlash;
}
}))
.pipe(ghPages())
);