Skip to content

Commit

Permalink
fix: source map on dynamic import (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber authored Nov 22, 2023
1 parent 0d54c99 commit 7a0eb7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/transform/transform-dynamic-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const transformDynamicImport = (
* The performance hit on this is very high
* Since we're only transforming import()s, I think this may be overkill
*/
// hires: 'boundary',
hires: 'boundary',
}) as SourceMap;

return {
Expand Down
3 changes: 2 additions & 1 deletion tests/specs/smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ export default 1;
`;

const sourcemap = {
// Adding the dynamic import helps test the import transformation's source map
test: (
extension: string,
) => `const { stack } = new Error(); const searchString = 'index.${extension}:SOURCEMAP_LINE'; assert(stack.includes(searchString), \`Expected \${searchString} in stack: \${stack}\`)`,
) => `import('fs');\nconst { stack } = new Error(); const searchString = 'index.${extension}:SOURCEMAP_LINE'; assert(stack.includes(searchString), \`Expected \${searchString} in stack: \${stack}\`)`,
tag: (
strings: TemplateStringsArray,
...values: string[]
Expand Down

0 comments on commit 7a0eb7e

Please sign in to comment.