Ghost/core/frontend/services/card-assets/index.js
Hannah Wolfe fdf38ba8c6
Initial card asset service implementation
- 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
2021-11-04 11:34:40 +00:00

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;