Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const colorFunction = require('postcss-color-mod-function');
const cssnano = require('cssnano');
const easyimport = require('postcss-easy-import');

// translations support
const { mergeLocales } = require('@tryghost/theme-translations/build');

const REPO = 'TryGhost/Casper';
const REPO_READONLY = 'TryGhost/Casper';
const CHANGELOG_PATH = path.join(process.cwd(), '.', 'changelog.md');
Expand Down Expand Up @@ -89,11 +92,19 @@ function zipper(done) {
], handleError(done));
}

function locales(done) {
mergeLocales({
local: './locales-local',
output: './locales'
})(done);
}

const cssWatcher = () => watch('assets/css/**', css);
const jsWatcher = () => watch('assets/js/**', js);
const hbsWatcher = () => watch(['*.hbs', 'partials/**/*.hbs'], hbs);
const watcher = parallel(cssWatcher, jsWatcher, hbsWatcher);
const build = series(css, js);
const localesWatcher = () => watch('./locales-local/**/*.json', locales);
const watcher = parallel(cssWatcher, jsWatcher, hbsWatcher, localesWatcher);
const build = series(css, js, locales);

exports.build = build;
exports.zip = series(build, zipper);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"contributors": "https://github.com/TryGhost/Casper/graphs/contributors",
"devDependencies": {
"@tryghost/release-utils": "0.8.1",
"@tryghost/theme-translations": "^0.0.9",
"autoprefixer": "10.4.24",
"beeper": "2.1.0",
"cssnano": "7.1.2",
Expand Down