MCPcopy
hub / github.com/11ty/buildawesome / setLibrary

Method setLibrary

src/UserConfig.js:848–860  ·  view source on GitHub ↗
(engineName, libraryInstance)

Source from the content-addressed store, hash-verified

846 * Library Overrides and Options
847 */
848 setLibrary(engineName, libraryInstance) {
849 if (engineName === "liquid" && Object.keys(this.liquid.options).length) {
850 debug(
851 "WARNING: using `eleventyConfig.setLibrary` will override any configuration set using `.setLiquidOptions` via the config API. You’ll need to pass these options to the library yourself.",
852 );
853 } else if (engineName === "njk" && Object.keys(this.nunjucks.environmentOptions).length) {
854 debug(
855 "WARNING: using `eleventyConfig.setLibrary` will override any configuration set using `.setNunjucksEnvironmentOptions` via the config API. You’ll need to pass these options to the library yourself.",
856 );
857 }
858
859 this.libraryOverrides[engineName.toLowerCase()] = libraryInstance;
860 }
861
862 /* These callbacks run on both libraryOverrides and default library instances */
863 amendLibrary(engineName, callback) {

Calls

no outgoing calls

Tested by

no test coverage detected