UNPKG

flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

1 lines 1.21 kB
{"version":3,"file":"add-plugin.cjs","sources":["../../../src/cli/utils/add-plugin.ts"],"sourcesContent":["import { addToConfig } from \"./add-to-config\";\n\n/**\n * Modifies the given content by adding a plugin to a specified path within the content.\n *\n * @param {Object} options - Options for adding a plugin.\n * @param {string} options.content - The content to modify.\n * @param {string} options.targetPath - The dot-separated path where the plugin will be added.\n * @param {string} options.pluginName - The name of the plugin to add.\n * @returns {string} The modified content with the added plugin.\n */\nexport function addPlugin({\n content,\n targetPath,\n pluginName,\n}: {\n content: string;\n targetPath: string;\n pluginName: string;\n}): string {\n return addToConfig({\n content,\n targetPath,\n valueGenerator: (b) => b.callExpression(b.identifier(pluginName), []),\n });\n}\n"],"names":["addToConfig"],"mappings":";;;;AAEO,SAAS,SAAS,CAAC;AAC1B,EAAE,OAAO;AACT,EAAE,UAAU;AACZ,EAAE;AACF,CAAC,EAAE;AACH,EAAE,OAAOA,uBAAW,CAAC;AACrB,IAAI,OAAO;AACX,IAAI,UAAU;AACd,IAAI,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,EAAE;AACxE,GAAG,CAAC;AACJ;;;;"}