To use @microsoft/api-extractor
in a Rollup project, you need to do the following:
@rollup/plugin-commonjs
and @rollup/plugin-node-resolve
packages as devDependencies@microsoft/api-extractor
as devDependenciesrollup.config.mjs
file in your projectrollup.config.mjs
to include api-extractor
Here's an example of the rollup.config.mjs
file with api-extractor
configuration options:
index.tsx780 chars23 lines
Once you have your rollup.config.mjs
file configured, you can run rollup
to build your project and api-extractor
will generate its output files according to the apiExtractor
options that you've specified.
Note: Make sure to set your tsconfig.json to "declaration": true , to enable TypeScript to emit declarations (type definitions) for your code that api-extractor will use to generate the documentation.
gistlibby LogSnag