Including Library in Office Addin for Production Build
I am writing an office addin for Excel. The code I have written has a dependency on the mathjs and accounting libraries. I am developing in Visual Studio Code.
To simplify I built the Excel addin with custom functions and a shared runtime in TypeScript. I edited the taskpane.ts file to include:
import
at the beginning and modified the run function to call this.
export
To get this code to work, I ran npm install mathjs in a terminal from Visual Studio Code. This works in development.
The problem I have is that "npm run build" fails with
> excel-custom-functions@
How to I properly include this library in the production build?
I checked that mathjs is included in the dependencies in the package.json. I tried using externals in the webpack.config.js file. This allowed npm run build to work, but the addin no longer loaded in development. I tested that npm run build:dev works