Integration by Environment
pptxgenjs can be used in various JavaScript environments. Select the integration method below that matches your project setup.
Available Distributions
- ES6 Module
dist/pptxgen.es.js - CommonJS
dist/pptxgen.cjs.js - Browser
dist/pptxgen.min.js
Environment Guide
The Quick Start shows the browser and Node code side by side, and each API Reference page includes runnable snippets.
Troubleshooting
Webpack
The library has been tested with several framework and bundler combinations, including Rsbuild, Rspack, and Webpack. Most projects can install pptxgenjs-plus without additional configuration; however, build errors can occur in some setups.
The following example is from Docusaurus v3.7, where Webpack v5 fails during the build process:
The error is being caused by the use of the "node:" prefix within "browser" field in pptxgenjs' package.json file.
Starting in version 4.0.0, node modules are excluded using this format in the library source, so most bundlers resolve them to empty modules automatically.
Excluding "node:" from Webpack Builds
Older Webpack setups (e.g. Docusaurus v3 on Webpack v5) may still fail on the node: scheme:
Tell Webpack to ignore the node: prefix by adding a NormalModuleReplacementPlugin in your
webpack.config.js (or the equivalent hook in your framework's build config):
Webpack now resolves the node: items via the browser field and builds successfully.