Skip to content

Commit 1b610f0

Browse files
authored
fix(core): Fix vite complaining about CJS import of webpack-sources (#210)
1 parent dcaf0cb commit 1b610f0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
- "You know what they say ‘Fool me once, strike one, but fool me twice… strike three.’" — Michael Scott
66

7+
## 0.7.1
8+
9+
- fix(core): Fix vite complaining about CJS import of webpack-sources (#210)
10+
711
## 0.7.0
812

913
This release introduces the `sourcemaps` option. This option switches to a new system of handling source maps in Sentry.

Diff for: packages/bundler-plugin-core/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { promisify } from "util";
3030
import { getDependencies, getPackageJson, parseMajorVersion, stringToUUID } from "./utils";
3131
import { glob } from "glob";
3232
import { injectDebugIdSnippetIntoChunk, prepareBundleForDebugIdUpload } from "./debug-id";
33-
import { SourceMapSource } from "webpack-sources";
33+
import webpackSources from "webpack-sources";
3434
import type { sources } from "webpack";
3535

3636
const ALLOWED_TRANSFORMATION_FILE_ENDINGS = [".js", ".ts", ".jsx", ".tsx", ".mjs"];
@@ -465,7 +465,7 @@ const unplugin = createUnplugin<Options, true>((userOptions, unpluginMetaContext
465465
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
466466
newSourceMap.sourcesContent = originalSourceMap.sourcesContent as string[];
467467

468-
const newSource = new SourceMapSource(
468+
const newSource = new webpackSources.SourceMapSource(
469469
newCode,
470470
fileName,
471471
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument

0 commit comments

Comments
 (0)