UNPKG

@pega/constellation-dx-components-build-utils

Version:

This tool uses a 'v3' approach to group components in a library, create a component map, employ webpack, and load the library like Pega-generated components, constellation app-static.

17 lines (16 loc) 544 B
class DynamicFetchScriptHookPlugin { apply(compiler) { compiler.hooks.compilation.tap( "DynamicFetchScriptHookPlugin", (compilation) => compilation.mainTemplate.hooks.jsonpScript.tap( "DynamicFetchScriptHookPlugin", (source) => [ source, "if (typeof dynamicFetchScriptHook === 'function') {", " script = dynamicFetchScriptHook(script);", "}" ].join("\n") ) ); } } module.exports = DynamicFetchScriptHookPlugin;