From 65fe01967147af2a8d2e37c4cc5aadb817dcbcf3 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Fri, 4 Apr 2025 10:37:17 +0200 Subject: [PATCH 1/2] fix(webpack5): Ensure all `esm` files have `.mjs` postfix --- CHANGELOG.md | 4 ++++ packages/webpack-plugin/rollup.config.js | 1 + 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 537e3d19..7634e8f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - "You know what they say ‘Fool me once, strike one, but fool me twice… strike three.’" — Michael Scott +## 3.3.1 + +- fix(webpack5): All `esm` files must have `.mjs` postfix (#721) + ## 3.3.0 - feat(webpack): Add `@sentry/webpack-plugin/webpack5` export for webpack 5.1+ and compatible environments (#715) diff --git a/packages/webpack-plugin/rollup.config.js b/packages/webpack-plugin/rollup.config.js index 3f0be962..f748b6fc 100644 --- a/packages/webpack-plugin/rollup.config.js +++ b/packages/webpack-plugin/rollup.config.js @@ -38,6 +38,7 @@ export default { exports: "named", sourcemap: true, entryFileNames: "[name].mjs", + chunkFileNames: "[name].mjs", }, { dir: "./dist/cjs", From b106e1dfa056f2215c65c86803f2b83ede2e2d42 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Fri, 4 Apr 2025 10:41:34 +0200 Subject: [PATCH 2/2] remove hash for cjs modules --- packages/webpack-plugin/rollup.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/webpack-plugin/rollup.config.js b/packages/webpack-plugin/rollup.config.js index f748b6fc..ea1dc3b6 100644 --- a/packages/webpack-plugin/rollup.config.js +++ b/packages/webpack-plugin/rollup.config.js @@ -45,6 +45,8 @@ export default { format: "cjs", exports: "named", sourcemap: true, + entryFileNames: "[name].js", + chunkFileNames: "[name].js", }, ], };