@studyportals/webpack-helper 6.0.7-15 → 6.0.7-17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/webpack-helper",
3
- "version": "6.0.7-15",
3
+ "version": "6.0.7-17",
4
4
  "description": "A collection of standard configurations and helpers for webpack.",
5
5
  "main": "src/main.js",
6
6
  "scripts": {
@@ -31,15 +31,18 @@ class ChunksRetryPluginFactory {
31
31
  const { retryChunksConfig } = preset;
32
32
  let lastResortScript = ``;
33
33
  if (retryChunksConfig.thresholdReachedCallBack) {
34
- lastResortScript = `${eval(retryChunksConfig.thresholdReachedCallBack.toString())}`;
34
+ lastResortScript += `
35
+ ${retryChunksConfig.thresholdReachedCallBack}
36
+ `;
35
37
  }
36
38
  if (!retryChunksConfig.disableDefaultRollbarError) {
37
- lastResortScript = `
38
- if (!window || !window['rollbar'] || !window['rollbar'].error) {
39
+ const rollbarInstanceIdentifier = retryChunksConfig.rollbarInstanceIdentifier || 'rollbar';
40
+ lastResortScript += `
41
+ if (!window || !window['${rollbarInstanceIdentifier}'] || !window['${rollbarInstanceIdentifier}'].error) {
39
42
  return;
40
43
  }
41
44
 
42
- window['rollbar'].error(new Error('Failed to load chunk for after retries'));
45
+ window['${rollbarInstanceIdentifier}'].error(new Error('Failed to load chunk for after retries'));
43
46
  `;
44
47
  }
45
48
  return lastResortScript;
@@ -41,6 +41,7 @@ class Configuration {
41
41
  this.fileName = options.output.fileName || "[name]";
42
42
  this.chunksRetryConfig = options.chunksRetryConfig || {
43
43
  threshold: DEFAULT_CHUNKS_RETRY_CONFIG_THRESHOLD,
44
+ rollbarInstanceIdentifier: 'rollbar',
44
45
  inject: this.preset === preset_1.Preset.VUE_TYPESCRIPT
45
46
  };
46
47
  }