vite-custom-functions-metadata
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

vite-custom-functions-metadata

A Vite plugin for generating and injecting Custom Functions metadata for Office Add-ins.

Installation

npm install --save-dev vite-custom-functions-metadata
# or
yarn add -D vite-custom-functions-metadata
# or
pnpm add -D vite-custom-functions-metadata

Usage

Add the plugin to your vite.config.ts:

import { defineConfig } from "vite";
import customFunctionsMetadataPlugin from "vite-custom-functions-metadata";

export default defineConfig({
  plugins: [
    customFunctionsMetadataPlugin({
      input: "./src/functions.ts", // Path to your functions file (or array of files)
      output: "assets/functions.json", // Output path for the metadata JSON
    }),
  ],
});

Options

Option Type Description
input string or string[] Path(s) to your function source file(s)
output string Output path for the metadata JSON file
verbose boolean Enable detailed logging (default: false)

Features

  • Generates metadata JSON for Custom Functions
  • Automatically adds CustomFunctions.associate() calls to your source files
  • Works in both development and production modes
  • Creates and serves metadata file during development

Requirements

This plugin has the following peer dependencies:

  • vite (>= 2.0.0)
  • custom-functions-metadata (>= 1.0.0)

License

MIT

Package Sidebar

Install

npm i vite-custom-functions-metadata

Weekly Downloads

6

Version

1.0.6

License

MIT

Unpacked Size

26.2 kB

Total Files

8

Last publish

Collaborators

  • boramdarkwill