Skip to content

Commit e97f821

Browse files
committed
Remove SSG tasks
1 parent 3419b23 commit e97f821

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

.core/gulp.tasks.js

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -463,53 +463,6 @@ const reactium = (gulp, config, webpackConfig) => {
463463
// Stub serviceWorker task. Implementation moved to @atomic-reactor/reactium-service-worker plugin
464464
const serviceWorker = () => Promise.resolve();
465465

466-
const ssg = gulp.series(task('ssg:flush'), task('ssg:warm'));
467-
468-
const ssgFlush = () => {
469-
console.log(chalk.yellow('Flushing Server Side Generated HTML'));
470-
del.sync([config.dest.dist + '/static-html']);
471-
return Promise.resolve();
472-
};
473-
474-
const ssgWarm = async () => {
475-
console.log(chalk.green('Warming Server Side Generated HTML'));
476-
const serverUrl = `http://localhost:${port}`;
477-
478-
let paths = [];
479-
try {
480-
const { data = [] } = await axios.get(serverUrl + '/ssg-paths');
481-
paths = data;
482-
} catch ({ response = {} }) {
483-
const { status, statusText, data } = response;
484-
const error = op.get(data, 'error', { status, statusText, data });
485-
throw new Error(
486-
`Getting generation paths: ${JSON.stringify(error)}`,
487-
);
488-
}
489-
490-
for (let chunk of _.chunk(paths, 5)) {
491-
try {
492-
await Promise.all(
493-
chunk.map(warmPath => {
494-
console.log(
495-
chalk.green('Warming URL:'),
496-
chalk.blueBright(serverUrl + warmPath),
497-
);
498-
return axios
499-
.get(serverUrl + warmPath)
500-
.catch(error =>
501-
console.error(
502-
`Error warming ${serverUrl + warmPath}`,
503-
),
504-
);
505-
}),
506-
);
507-
} catch (error) {
508-
console.error(error);
509-
}
510-
}
511-
};
512-
513466
const staticTask = task('static:copy');
514467

515468
const staticCopy = done => {
@@ -912,9 +865,6 @@ $assets: (
912865
'serve-restart': serve({ open: false }),
913866
serviceWorker,
914867
sw,
915-
ssg,
916-
'ssg:flush': ssgFlush,
917-
'ssg:warm': ssgWarm,
918868
static: staticTask,
919869
'static:copy': staticCopy,
920870
'styles:partials': dddStylesPartial,

0 commit comments

Comments
 (0)