@sentry/bundler-plugin-core 3.0.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -8111,7 +8111,7 @@ function createSentryInstance(options, shouldSendTelemetry, bundler) {
8111
8111
  dsn: "https://4c2bae7d9fbc413e8f7385f55c515d51@o1.ingest.sentry.io/6690737",
8112
8112
  tracesSampleRate: 1,
8113
8113
  sampleRate: 1,
8114
- release: "3.0.0",
8114
+ release: "3.1.1",
8115
8115
  integrations: [],
8116
8116
  tracePropagationTargets: ["sentry.io/api"],
8117
8117
  stackParser: stackParser,
@@ -9094,6 +9094,11 @@ function sentryUnpluginFactory(_ref) {
9094
9094
  silent: (_userOptions$silent = userOptions.silent) !== null && _userOptions$silent !== void 0 ? _userOptions$silent : false,
9095
9095
  debug: (_userOptions$debug = userOptions.debug) !== null && _userOptions$debug !== void 0 ? _userOptions$debug : false
9096
9096
  });
9097
+
9098
+ // Not a bulletproof check but should be good enough to at least sometimes determine
9099
+ // if the plugin is called in dev/watch mode or for a prod build. The important part
9100
+ // here is to avoid a false positive. False negatives are okay.
9101
+ var isDevMode = process.env["NODE_ENV"] === "development";
9097
9102
  try {
9098
9103
  var dotenvFile = fs__namespace.readFileSync(path__namespace.join(process.cwd(), ".env.sentry-build-plugin"), "utf-8");
9099
9104
  // NOTE: Do not use the dotenv.config API directly to read the dotenv file! For some ungodly reason, it falls back to reading `${process.cwd()}/.env` which is absolutely not what we want.
@@ -9110,7 +9115,7 @@ function sentryUnpluginFactory(_ref) {
9110
9115
  }
9111
9116
  }
9112
9117
  var options = normalizeUserOptions(userOptions);
9113
- if (unpluginMetaContext.watchMode || options.disable) {
9118
+ if (options.disable) {
9114
9119
  return [{
9115
9120
  name: "sentry-noop-plugin"
9116
9121
  }];
@@ -9147,7 +9152,7 @@ function sentryUnpluginFactory(_ref) {
9147
9152
  });
9148
9153
 
9149
9154
  // Set the User-Agent that Sentry CLI will use when interacting with Sentry
9150
- process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "3.0.0");
9155
+ process.env["SENTRY_PIPELINE"] = "".concat(unpluginMetaContext.framework, "-plugin/", "3.1.1");
9151
9156
  function handleRecoverableError(unknownError) {
9152
9157
  sentrySession.status = "abnormal";
9153
9158
  try {
@@ -9252,7 +9257,7 @@ function sentryUnpluginFactory(_ref) {
9252
9257
  if (!options.release.inject) {
9253
9258
  logger.debug("Release injection disabled via `release.inject` option. Will not inject release.");
9254
9259
  } else if (!options.release.name) {
9255
- logger.warn("No release name provided. Will not inject release. Please set the `release.name` option to identify your release.");
9260
+ logger.debug("No release name provided. Will not inject release. Please set the `release.name` option to identify your release.");
9256
9261
  } else {
9257
9262
  var _injectionCode = generateGlobalInjectorCode({
9258
9263
  release: options.release.name,
@@ -9287,7 +9292,9 @@ function sentryUnpluginFactory(_ref) {
9287
9292
  plugins.push(moduleMetadataInjectionPlugin(_injectionCode2));
9288
9293
  }
9289
9294
  if (!options.release.name) {
9290
- logger.warn("No release name provided. Will not create release. Please set the `release.name` option to identify your release.");
9295
+ logger.debug("No release name provided. Will not create release. Please set the `release.name` option to identify your release.");
9296
+ } else if (isDevMode) {
9297
+ logger.debug("Running in development mode. Will not create release.");
9291
9298
  } else if (!options.authToken) {
9292
9299
  logger.warn("No auth token provided. Will not create release. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/");
9293
9300
  } else if (!options.org && !options.authToken.startsWith("sntrys_")) {
@@ -9324,6 +9331,8 @@ function sentryUnpluginFactory(_ref) {
9324
9331
  }
9325
9332
  if ((_options$sourcemaps2 = options.sourcemaps) !== null && _options$sourcemaps2 !== void 0 && _options$sourcemaps2.disable) {
9326
9333
  logger.debug("Source map upload was disabled. Will not upload sourcemaps using debug ID process.");
9334
+ } else if (isDevMode) {
9335
+ logger.debug("Running in development mode. Will not upload sourcemaps.");
9327
9336
  } else if (!options.authToken) {
9328
9337
  logger.warn("No auth token provided. Will not upload source maps. Please set the `authToken` option. You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/");
9329
9338
  } else if (!options.org && !options.authToken.startsWith("sntrys_")) {
@@ -9332,6 +9341,8 @@ function sentryUnpluginFactory(_ref) {
9332
9341
  logger.warn("No project provided. Will not upload source maps. Please set the `project` option to your Sentry project slug.");
9333
9342
  } else {
9334
9343
  var _options$sourcemaps3, _options$sourcemaps4, _options$sourcemaps5;
9344
+ // This option is only strongly typed for the webpack plugin, where it is used. It has no effect on other plugins
9345
+ var _webpack_forceExitOnBuildComplete = typeof options._experiments["forceExitOnBuildCompletion"] === "boolean" ? options._experiments["forceExitOnBuildCompletion"] : undefined;
9335
9346
  plugins.push(debugIdUploadPlugin(createDebugIdUploadFunction({
9336
9347
  assets: (_options$sourcemaps3 = options.sourcemaps) === null || _options$sourcemaps3 === void 0 ? void 0 : _options$sourcemaps3.assets,
9337
9348
  ignore: (_options$sourcemaps4 = options.sourcemaps) === null || _options$sourcemaps4 === void 0 ? void 0 : _options$sourcemaps4.ignore,
@@ -9352,7 +9363,7 @@ function sentryUnpluginFactory(_ref) {
9352
9363
  vcsRemote: options.release.vcsRemote,
9353
9364
  headers: options.headers
9354
9365
  }
9355
- }), logger));
9366
+ }), logger, _webpack_forceExitOnBuildComplete));
9356
9367
  }
9357
9368
  if (options.reactComponentAnnotation) {
9358
9369
  if (!options.reactComponentAnnotation.enabled) {