@studyportals/webpack-helper 6.0.3 → 6.0.5-0

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,13 +1,14 @@
1
1
  {
2
2
  "name": "@studyportals/webpack-helper",
3
- "version": "6.0.3",
3
+ "version": "6.0.5-0",
4
4
  "description": "A collection of standard configurations and helpers for webpack.",
5
5
  "main": "src/main.js",
6
6
  "scripts": {
7
7
  "test": "vitest --watch=false --coverage",
8
8
  "build": "tsc",
9
9
  "prepublish": "npm run build",
10
- "postinstall": "cp ./assets/.browserslistrc ../../../"
10
+ "postinstall": "cp ./assets/.browserslistrc ../../../",
11
+ "deploy-beta": "npm version prerelease && npm run build && npm publish --tag beta --access=public && rm -rf node_modules"
11
12
  },
12
13
  "files": [
13
14
  "src/**/*.js",
@@ -6,5 +6,4 @@ var Preset;
6
6
  Preset["VUE_TYPESCRIPT"] = "vue-typescript";
7
7
  Preset["TYPESCRIPT"] = "typescript";
8
8
  Preset["JAVASCRIPT"] = "javascript";
9
- Preset["VUE_TYPESCRIPT_NO_CODE_SPLITTING"] = "vue-typescript-no-code-splitting";
10
9
  })(Preset || (exports.Preset = Preset = {}));
@@ -9,7 +9,6 @@ const preset_1 = require("../enums/preset");
9
9
  const vue_typescript_preset_1 = require("../presets/vue-typescript.preset");
10
10
  const typescript_preset_1 = require("../presets/typescript.preset");
11
11
  const javascript_preset_1 = require("../presets/javascript.preset");
12
- const vue_typescript_no_code_splitting_preset_1 = require("../presets/vue-typescript-no-code-splitting.preset");
13
12
  const mode_1 = require("../enums/mode");
14
13
  const production_config_1 = require("../defaults/production.config");
15
14
  const development_config_1 = require("../defaults/development.config");
@@ -18,6 +17,7 @@ const DllReferencePlugin = require("@studyportals/bob-manifest-generator").DllRe
18
17
  const { merge } = require('webpack-merge');
19
18
  class Configuration {
20
19
  constructor(options) {
20
+ this.customElementTags = options.customElementTags || [];
21
21
  this.bob = options.bob || null;
22
22
  this.entry = new entry_1.Entry(options.entry);
23
23
  this.output = new output_1.Output(options.output);
@@ -57,7 +57,7 @@ class Configuration {
57
57
  detectPresets(mode) {
58
58
  switch (this.preset) {
59
59
  case preset_1.Preset.VUE_TYPESCRIPT:
60
- this.injectPreset(new vue_typescript_preset_1.VueTypeScriptPreset(mode));
60
+ this.injectPreset(new vue_typescript_preset_1.VueTypeScriptPreset(mode, this.customElementTags));
61
61
  break;
62
62
  case preset_1.Preset.TYPESCRIPT:
63
63
  this.injectPreset(new typescript_preset_1.TypeScriptPreset());
@@ -65,9 +65,6 @@ class Configuration {
65
65
  case preset_1.Preset.JAVASCRIPT:
66
66
  this.injectPreset(new javascript_preset_1.JavascriptPreset());
67
67
  break;
68
- case preset_1.Preset.VUE_TYPESCRIPT_NO_CODE_SPLITTING:
69
- this.injectPreset(new vue_typescript_no_code_splitting_preset_1.VueTypescriptNoCodeSplittingPreset(mode));
70
- break;
71
68
  default:
72
69
  break;
73
70
  }
@@ -26,7 +26,12 @@ class JavascriptPreset {
26
26
  use: [
27
27
  MiniCssExtractPlugin.loader,
28
28
  'css-loader',
29
- 'sass-loader'
29
+ {
30
+ loader: 'sass-loader',
31
+ options: {
32
+ api: 'modern-compiler'
33
+ }
34
+ }
30
35
  ],
31
36
  },
32
37
  {
@@ -26,7 +26,12 @@ class TypeScriptPreset {
26
26
  use: [
27
27
  MiniCssExtractPlugin.loader,
28
28
  'css-loader',
29
- 'sass-loader'
29
+ {
30
+ loader: 'sass-loader',
31
+ options: {
32
+ api: 'modern-compiler'
33
+ }
34
+ }
30
35
  ],
31
36
  },
32
37
  {
@@ -1,20 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VueTypescriptNoCodeSplittingPreset = void 0;
4
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
- const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
6
- const vue_typescript_preset_1 = require("./vue-typescript.preset");
7
- class VueTypescriptNoCodeSplittingPreset extends vue_typescript_preset_1.VueTypeScriptPreset {
8
- constructor(mode) {
9
- super(mode);
10
- }
11
- getPlugins(filename) {
12
- return [
13
- new MiniCssExtractPlugin({
14
- filename
15
- }),
16
- new VueLoaderPlugin()
17
- ];
18
- }
19
- }
20
- exports.VueTypescriptNoCodeSplittingPreset = VueTypescriptNoCodeSplittingPreset;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VueTypescriptNoCodeSplittingPreset = void 0;
4
+ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
+ const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
6
+ const vue_typescript_preset_1 = require("./vue-typescript.preset");
7
+ class VueTypescriptNoCodeSplittingPreset extends vue_typescript_preset_1.VueTypeScriptPreset {
8
+ constructor(mode) {
9
+ super(mode);
10
+ }
11
+ getPlugins(filename) {
12
+ return [
13
+ new MiniCssExtractPlugin({
14
+ filename
15
+ }),
16
+ new VueLoaderPlugin()
17
+ ];
18
+ }
19
+ }
20
+ exports.VueTypescriptNoCodeSplittingPreset = VueTypescriptNoCodeSplittingPreset;
@@ -8,8 +8,9 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
8
8
  const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
9
9
  const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
10
10
  class VueTypeScriptPreset {
11
- constructor(mode) {
11
+ constructor(mode, customElementTags) {
12
12
  this.mode = mode;
13
+ this.customElementTags = customElementTags;
13
14
  }
14
15
  getPlugins(filename) {
15
16
  return [
@@ -39,7 +40,12 @@ class VueTypeScriptPreset {
39
40
  use: [
40
41
  MiniCssExtractPlugin.loader,
41
42
  'css-loader',
42
- 'sass-loader'
43
+ {
44
+ loader: 'sass-loader',
45
+ options: {
46
+ api: 'modern-compiler'
47
+ }
48
+ }
43
49
  ],
44
50
  },
45
51
  {
@@ -53,7 +59,10 @@ class VueTypeScriptPreset {
53
59
  'sass-loader'
54
60
  ]
55
61
  },
56
- hotReload: false
62
+ hotReload: false,
63
+ compilerOptions: {
64
+ isCustomElement: (tag) => this.customElementTags.includes(tag)
65
+ }
57
66
  }
58
67
  },
59
68
  {