mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 04:59:40 +00:00
fix(gulp): do not use common code in imports when it has not been transpiled yet
This commit is contained in:
parent
6bef105cf6
commit
1a75c6a696
1 changed files with 8 additions and 9 deletions
|
|
@ -1,15 +1,14 @@
|
|||
import gulp from 'gulp';
|
||||
import fs from 'fs';
|
||||
import clean from 'rimraf';
|
||||
import { CONTENT_CACHE_PATH, getLocalizedContent } from '../website/server/libs/content';
|
||||
import { langCodes } from '../website/server/libs/i18n';
|
||||
|
||||
gulp.task('content:cache:clean', done => {
|
||||
clean(CONTENT_CACHE_PATH, done);
|
||||
});
|
||||
|
||||
// TODO parallelize, use gulp file helpers
|
||||
gulp.task('content:cache', gulp.series('content:cache:clean', done => {
|
||||
gulp.task('content:cache', done => {
|
||||
// Requiring at runtime because these files access `common`
|
||||
// code which in production works only if transpiled so after
|
||||
// gulp build:babel:common has run
|
||||
const { CONTENT_CACHE_PATH, getLocalizedContent } = require('../website/server/libs/content'); // eslint-disable-line global-require
|
||||
const { langCodes } = require('../website/server/libs/i18n'); // eslint-disable-line global-require
|
||||
|
||||
try {
|
||||
// create the cache folder (if it doesn't exist)
|
||||
try {
|
||||
|
|
@ -32,4 +31,4 @@ gulp.task('content:cache', gulp.series('content:cache:clean', done => {
|
|||
} catch (err) {
|
||||
done(err);
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue