{"id":19436,"library":"custom-functions-metadata-plugin","title":"Custom Functions Metadata WebPack Plugin","description":"A WebPack plugin (v2.1.7) for Office Add-ins that generates the metadata JSON file required by Excel custom functions. It pairs with the Custom Functions runtime to define function names, parameters, and descriptions. This plugin is specific to the Office Add-in development lifecycle and requires WebPack 5. It is part of the Office-Addin-Scripts monorepo maintained by Microsoft. Key differentiators: it auto-generates metadata from JavaScript/TypeScript comments, integrates tightly with WebPack 5, and is the official Microsoft tool for enabling Excel custom functions in web add-ins.","status":"active","version":"2.1.7","language":"javascript","source_language":"en","source_url":"https://github.com/OfficeDev/Office-Addin-Scripts","tags":["javascript","Office","Office Add-in","Excel Custom Functions","typescript"],"install":[{"cmd":"npm install custom-functions-metadata-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add custom-functions-metadata-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add custom-functions-metadata-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - plugin only works with Webpack 5","package":"webpack","optional":false}],"imports":[{"note":"This plugin is CommonJS-only and does not support ESM imports.","wrong":"import CustomFunctionsMetadataPlugin from 'custom-functions-metadata-plugin';","symbol":"CustomFunctionsMetadataPlugin","correct":"const CustomFunctionsMetadataPlugin = require('custom-functions-metadata-plugin');"}],"quickstart":{"code":"const CustomFunctionsMetadataPlugin = require('custom-functions-metadata-plugin');\n\nmodule.exports = {\n  // ... other webpack config ...\n  plugins: [\n    new CustomFunctionsMetadataPlugin({\n      input: './src/functions.js',\n      output: './dist/functions.json'\n    })\n  ]\n};","lang":"javascript","description":"Shows how to add the plugin to a WebPack config to generate Excel custom functions metadata from a source file."},"warnings":[{"fix":"Update WebPack to version 5 or stay on plugin v1.x.","message":"Requires WebPack 5, not compatible with WebPack 4.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Add @customfunction JSDoc tag and parameter descriptions to each exported function.","message":"Input file must contain JSDoc-style comments for each custom function. Without comments, metadata will be empty.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `office-addin-manifest modify` for manifest changes instead of relying on this plugin.","message":"Plugin is part of a monorepo that also contains office-addin-manifest; manifest modifications moved to a separate command in v1.1.0.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Add input: './path/to/functions.js' to the plugin options.","cause":"Missing input option in plugin configuration.","error":"Error: 'input' is required"},{"fix":"Ensure input file exports functions with JSDoc comments and is a valid module.","cause":"WebPack cannot parse the input file (likely not a valid JS/TS module).","error":"Error: Module parse failed: Unexpected token (1:0)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}