Skip to content

Commit 8094166

Browse files
Andaristcodex
andcommitted
fix(bundler-plugins): Recognize mts and cts webpack assets
Co-Authored-By: OpenAI Codex <codex@openai.com>
1 parent a04a30b commit 8094166

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/bundler-plugins/src/webpack/webpack4and5.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ type WebpackReplaceSource = WebpackSource & {
9494
insert: (position: number, value: string) => void;
9595
};
9696

97-
const WEBPACK_JAVASCRIPT_ASSET_REGEX = /\.(?:js|ts|jsx|tsx|mjs|cjs)(?:\?[^?]*)?(?:#[^#]*)?$/;
97+
const WEBPACK_JAVASCRIPT_ASSET_REGEX = /\.(?:js|ts|jsx|tsx|mjs|cjs|mts|cts)(?:\?[^?]*)?(?:#[^#]*)?$/;
9898

9999
type WebpackCompiler = {
100100
options: {

packages/bundler-plugins/test/webpack/webpack4and5.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe('sentryWebpackPluginFactory', () => {
105105
expect(Object.keys(context._sentryDebugIds ?? {})).toHaveLength(1);
106106
});
107107

108-
it.each(['.ts', '.tsx', '.jsx'])('injects into a %s asset', extension => {
108+
it.each(['.ts', '.tsx', '.jsx', '.mts', '.cts'])('injects into a %s asset', extension => {
109109
const output = runWebpackInjection(`bundle${extension}`, 'globalThis.bundleLoaded = true;');
110110
const context: { _sentryDebugIds?: Record<string, string> } = {};
111111

0 commit comments

Comments
 (0)