mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
fdf38ba8c6
- Requires the new @tryghost/minifier package - Adds a new service that will handle taking config from the theme and optionally including assets for Koenig editor cards - It supports both css and js as cards may need one or both - For any given config, the tool can find the matching files to include and concat and minify them into one file per type - Currently has an override in place so that this is not yet customisable in the theme - will remove this override when we're ready for the feature
17 lines
482 B
JavaScript
17 lines
482 B
JavaScript
const debug = require('@tryghost/debug')('card-assets');
|
|
const themeEngine = require('../theme-engine');
|
|
|
|
const CardAssetService = require('./service');
|
|
let cardAssetService = new CardAssetService();
|
|
|
|
const initFn = async () => {
|
|
const cardAssetConfig = themeEngine.getActive().config('card_assets');
|
|
debug('initialising with config', cardAssetConfig);
|
|
|
|
await cardAssetService.load(cardAssetConfig);
|
|
};
|
|
|
|
module.exports = cardAssetService;
|
|
|
|
module.exports.init = initFn;
|