Open
Description
Environment
[email protected], @sentry/[email protected]
Steps to Reproduce
This injection logic should be placed below use strict
:
sentry-javascript-bundler-plugins/packages/webpack-plugin/src/index.ts
Lines 157 to 160 in febe9ce
In our case, TerserPlugin removes all the use strict
because it is not at the top of the file.
Possible Solution
A possible solution is to do like below:
new BannerPlugin({
raw: true,
include: /\.(js|ts|jsx|tsx|mjs|cjs)$/,
banner: injectionCode,
footer: true,
})
However, from webpack side, better not to use BannerPlugin to inject code, it's not designed for this. Can refer to webpack/webpack#18202
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status