@studyportals/webpack-helper 6.0.7-6 → 6.0.7-9

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-6",
3
+ "version": "6.0.7-9",
4
4
  "description": "A collection of standard configurations and helpers for webpack.",
5
5
  "main": "src/main.js",
6
6
  "scripts": {
@@ -4,20 +4,15 @@ const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin');
4
4
  class ChunksRetryPluginFactory {
5
5
  static InjectPlugin(preset) {
6
6
  if (!preset.retryChunksConfig) {
7
- return preset;
7
+ return;
8
8
  }
9
9
  // if (preset.mode === Mode.DEVELOPMENT) {
10
10
  // return preset;
11
11
  // }
12
12
  if (!preset.retryChunksConfig.inject) {
13
- return preset;
13
+ return;
14
14
  }
15
- preset.getPlugins = (filename) => {
16
- const plugins = preset.getPlugins(filename);
17
- plugins.push(ChunksRetryPluginFactory.CustomRetryChunksPlugin(preset));
18
- return plugins;
19
- };
20
- return preset;
15
+ preset.injectedPlugins.push(ChunksRetryPluginFactory.CustomRetryChunksPlugin(preset));
21
16
  }
22
17
  static CustomRetryChunksPlugin(preset) {
23
18
  const { retryChunksConfig } = preset;
@@ -79,8 +79,8 @@ class Configuration {
79
79
  }
80
80
  }
81
81
  injectPreset(preset) {
82
- const plugins = preset.getPlugins(this.getCSSFileName());
83
82
  chunks_retry_plugin_factory_1.default.InjectPlugin(preset);
83
+ const plugins = preset.getPlugins(this.getCSSFileName());
84
84
  const module = preset.getModule();
85
85
  plugins.forEach(plugin => {
86
86
  this.plugins.addPlugin(plugin);
@@ -7,12 +7,14 @@ class JavascriptPreset {
7
7
  constructor(mode, retryChunksConfig) {
8
8
  this.mode = mode;
9
9
  this.retryChunksConfig = retryChunksConfig;
10
+ this.injectedPlugins = [];
10
11
  }
11
12
  getPlugins(filename) {
12
13
  return [
13
14
  new MiniCssExtractPlugin({
14
15
  filename
15
- })
16
+ }),
17
+ ...this.injectedPlugins
16
18
  ];
17
19
  }
18
20
  getModule() {
@@ -7,12 +7,14 @@ class TypeScriptPreset {
7
7
  constructor(mode, retryChunksConfig) {
8
8
  this.mode = mode;
9
9
  this.retryChunksConfig = retryChunksConfig;
10
+ this.injectedPlugins = [];
10
11
  }
11
12
  getPlugins(filename) {
12
13
  return [
13
14
  new MiniCssExtractPlugin({
14
15
  filename
15
- })
16
+ }),
17
+ ...this.injectedPlugins
16
18
  ];
17
19
  }
18
20
  getModule() {
@@ -12,6 +12,7 @@ class VueTypeScriptPreset {
12
12
  this.mode = mode;
13
13
  this.retryChunksConfig = retryChunksConfig;
14
14
  this.customElementTags = customElementTags;
15
+ this.injectedPlugins = [];
15
16
  }
16
17
  getPlugins(filename) {
17
18
  return [
@@ -23,7 +24,8 @@ class VueTypeScriptPreset {
23
24
  filename,
24
25
  ignoreOrder: true
25
26
  }),
26
- new VueLoaderPlugin()
27
+ new VueLoaderPlugin(),
28
+ ...this.injectedPlugins
27
29
  ];
28
30
  }
29
31
  getModule() {
@@ -1 +0,0 @@
1
- "use strict";