This is a plugin to add cohesion script to the head element of Learning MFE
frontend-app-learning::env.config.jsx
import {
PLUGIN_OPERATIONS,
DIRECT_PLUGIN,
} from "@openedx/frontend-plugin-framework";
import Plugin from "@edx/cohesion-wrapper";
// Load environment variables from .env file
const config = {
...process.env,
pluginSlots: {
header_slot: {
plugins: [
{
op: PLUGIN_OPERATIONS.Insert,
widget: {
id: "cohesion_wrapper",
type: DIRECT_PLUGIN,
priority: 1,
RenderWidget: Plugin,
},
},
],
},
},
};
export default config;
frontend-app-learning::module.config.js
module.exports = {
localModules: [
{
moduleName: "@edx/cohesion-wrapper",
dir: "../src/frontend-plugins/packages/cohesion-wrapper",
},
],
};