Skip to content

Commit c104aee

Browse files
committed
fix: aws-serverless replace plugin
1 parent b3854c1 commit c104aee

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

dev-packages/rollup-utils/plugins/bundlePlugins.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function makeIsDebugBuildPlugin(includeDebugging) {
5252
export function makeSetSDKSourcePlugin(sdkSource) {
5353
return replacePlugin(
5454
{
55-
'/* __SENTRY_SDK_SOURCE__ */': `return ${JSON.stringify(sdkSource)};`,
55+
'/*! __SENTRY_SDK_SOURCE__ */': `return ${JSON.stringify(sdkSource)};`,
5656
},
5757
{
5858
preventAssignment: false,

packages/aws-serverless/scripts/buildLambdaLayer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ function replaceSDKSource(): void {
207207
// Replace the line marked with __SENTRY_SDK_SOURCE__ comment
208208
// Change from 'npm' to 'aws-lambda-layer' to identify that this is the AWS Lambda layer
209209
content = content.replace(
210-
"/* __SENTRY_SDK_SOURCE__ */ return 'npm';",
211-
"/* __SENTRY_SDK_SOURCE__ */ return 'aws-lambda-layer';",
210+
'/*! __SENTRY_SDK_SOURCE__ */ return "npm";',
211+
'/*! __SENTRY_SDK_SOURCE__ */ return "aws-lambda-layer";',
212212
);
213213

214214
fs.writeFileSync(envFile, content);

packages/core/src/utils/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ export function isBrowserBundle(): boolean {
3131
*/
3232
export function getSDKSource(): SdkSource {
3333
// This comment is used to identify this line in the CDN bundle build step and replace this with "return 'cdn';"
34-
/* __SENTRY_SDK_SOURCE__ */ return 'npm';
34+
/*! __SENTRY_SDK_SOURCE__ */ return 'npm';
3535
}

packages/eslint-config-sdk/src/base.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ module.exports = {
236236
balanced: true,
237237
// ... unless they're jsdoc-style block comments, which end with `**/`
238238
exceptions: ['*'],
239+
// Allow /*! for legal/preserved comments
240+
markers: ['!'],
239241
},
240242
},
241243
],

0 commit comments

Comments
 (0)