|
1 | 1 | import { getSentryRelease } from '@sentry/node';
|
2 |
| -import { dropUndefinedKeys, logger } from '@sentry/utils'; |
| 2 | +import { dropUndefinedKeys, escapeStringForRegex, logger } from '@sentry/utils'; |
3 | 3 | import { default as SentryWebpackPlugin } from '@sentry/webpack-plugin';
|
4 | 4 | import * as fs from 'fs';
|
5 | 5 | import * as os from 'os';
|
6 | 6 | import * as path from 'path';
|
7 |
| -// import * as rimraf from 'rimraf'; |
8 | 7 | import { WebpackPluginInstance } from 'webpack';
|
9 | 8 |
|
10 | 9 | // import { DefinePlugin, WebpackPluginInstance } from 'webpack';
|
@@ -156,8 +155,9 @@ async function addSentryToEntryProperty(
|
156 | 155 | );
|
157 | 156 | console.log('cwd', process.cwd());
|
158 | 157 | console.log('buildContext.dir', buildContext.dir);
|
159 |
| - const buildDirAbsPath = path.resolve(buildContext.dir, buildContext.config.distDir); |
160 |
| - fs.writeFileSync(rewriteFramesHelper, `global.__rewriteFramesDistDir__ = '${buildDirAbsPath}';\n`); |
| 158 | + const buildDirAbsPath = escapeStringForRegex(path.resolve(buildContext.dir, buildContext.config.distDir)); |
| 159 | + const awsAbsPath = escapeStringForRegex(path.resolve('/var/task', buildContext.config.distDir)); |
| 160 | + fs.writeFileSync(rewriteFramesHelper, `global.__rewriteFramesRegex__ = '${buildDirAbsPath}|${awsAbsPath}';\n`); |
161 | 161 | filesToInject.unshift(rewriteFramesHelper);
|
162 | 162 | }
|
163 | 163 |
|
|
0 commit comments