Skip to content

Commit

Permalink
feat(frontend): add sourcemaps to frontend package (#3212)
Browse files Browse the repository at this point in the history
<!-- Describe the problem and your solution --> 
The Nango frontend package does not export sourcemaps. When compiling my
frontend using `bun`, I received the following warnings:
```
Compiled with warnings.

Failed to parse source map from '/Users/izak/personal/vigilant/vigilant/dashboard/node_modules/@nangohq/frontend/dist/connectUI.js.map' file: Error: ENOENT: no such file or directory, open '/Users/izak/personal/vigilant/vigilant/dashboard/node_modules/@nangohq/frontend/dist/connectUI.js.map'

Failed to parse source map from '/Users/izak/personal/vigilant/vigilant/dashboard/node_modules/@nangohq/frontend/dist/index.js.map' file: Error: ENOENT: no such file or directory, open '/Users/izak/personal/vigilant/vigilant/dashboard/node_modules/@nangohq/frontend/dist/index.js.map'

Failed to parse source map from '/Users/izak/personal/vigilant/vigilant/dashboard/node_modules/@nangohq/frontend/dist/types.js.map' file: Error: ENOENT: no such file or directory, open '/Users/izak/personal/vigilant/vigilant/dashboard/node_modules/@nangohq/frontend/dist/types.js.map'

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
```

The fix is to add sourcemap exports when packaging the frontend library.

<!-- Issue ticket number and link (if applicable) -->

<!-- Testing instructions (skip if just adding/editing providers) -->
  • Loading branch information
izakfr authored Jan 2, 2025
1 parent 61f48b4 commit 531357b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"files": [
"dist/**/*.js",
"dist/**/*.d.ts",
"dist/**/*.map",
"!**/*.json",
"README.md"
]
Expand Down
5 changes: 4 additions & 1 deletion packages/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"compilerOptions": {
"lib": ["es2015", "dom"],
"rootDir": "lib",
"outDir": "dist"
"outDir": "dist",
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"references": [
{
Expand Down

0 comments on commit 531357b

Please sign in to comment.