@studyportals/webpack-helper 5.1.0 → 5.2.0-bf605c6b.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.
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Entry = void 0;
4
- class Entry {
5
- constructor(entry) {
6
- this.entry = entry;
7
- }
8
- getEntry() {
9
- return this.entry;
10
- }
11
- }
12
- exports.Entry = Entry;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Entry = void 0;
4
+ class Entry {
5
+ constructor(entry) {
6
+ this.entry = entry;
7
+ }
8
+ getEntry() {
9
+ return this.entry;
10
+ }
11
+ }
12
+ exports.Entry = Entry;
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Module = void 0;
4
- const { merge } = require('webpack-merge');
5
- class Module {
6
- constructor(module = {}) {
7
- this.module = {};
8
- this.module = merge(this.module, module);
9
- }
10
- setModule(module) {
11
- this.module = merge(this.module, module);
12
- }
13
- getModule() {
14
- return this.module;
15
- }
16
- }
17
- exports.Module = Module;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Module = void 0;
4
+ const { merge } = require('webpack-merge');
5
+ class Module {
6
+ constructor(module = {}) {
7
+ this.module = {};
8
+ this.module = merge(this.module, module);
9
+ }
10
+ setModule(module) {
11
+ this.module = merge(this.module, module);
12
+ }
13
+ getModule() {
14
+ return this.module;
15
+ }
16
+ }
17
+ exports.Module = Module;
@@ -1,45 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Output = void 0;
4
- class Output {
5
- constructor(outputConfig) {
6
- this.path = outputConfig.path;
7
- this.publicPath = typeof outputConfig.publicPath === "string" ? outputConfig.publicPath : null;
8
- this.library = outputConfig.library || null;
9
- this.addHash = this.shouldAddHash(outputConfig.hash),
10
- this.fileName = outputConfig.fileName || "[name]";
11
- this.crossOriginLoading = outputConfig.crossOriginLoading || null;
12
- }
13
- getOutput() {
14
- let output = {
15
- path: this.path,
16
- filename: this.getFileName()
17
- };
18
- if (this.publicPath !== null) {
19
- output.publicPath = this.publicPath;
20
- }
21
- if (this.library !== null) {
22
- output.library = this.library;
23
- }
24
- if (this.crossOriginLoading !== null) {
25
- output.crossOriginLoading = this.crossOriginLoading;
26
- }
27
- return output;
28
- }
29
- getFileName() {
30
- let fileName = this.addHash === true ? `${this.fileName}.[fullhash].js` : `${this.fileName}.js`;
31
- return fileName;
32
- }
33
- shouldAddHash(hashConfig) {
34
- if (typeof hashConfig === 'undefined') {
35
- return true;
36
- }
37
- if (typeof hashConfig.js !== 'undefined'
38
- && hashConfig.js === false
39
- || hashConfig === false) {
40
- return false;
41
- }
42
- return true;
43
- }
44
- }
45
- exports.Output = Output;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Output = void 0;
4
+ class Output {
5
+ constructor(outputConfig) {
6
+ this.path = outputConfig.path;
7
+ this.publicPath = typeof outputConfig.publicPath === "string" ? outputConfig.publicPath : null;
8
+ this.library = outputConfig.library || null;
9
+ this.addHash = this.shouldAddHash(outputConfig.hash),
10
+ this.fileName = outputConfig.fileName || "[name]";
11
+ this.crossOriginLoading = outputConfig.crossOriginLoading || null;
12
+ }
13
+ getOutput() {
14
+ let output = {
15
+ path: this.path,
16
+ filename: this.getFileName()
17
+ };
18
+ if (this.publicPath !== null) {
19
+ output.publicPath = this.publicPath;
20
+ }
21
+ if (this.library !== null) {
22
+ output.library = this.library;
23
+ }
24
+ if (this.crossOriginLoading !== null) {
25
+ output.crossOriginLoading = this.crossOriginLoading;
26
+ }
27
+ return output;
28
+ }
29
+ getFileName() {
30
+ let fileName = this.addHash === true ? `${this.fileName}.[fullhash].js` : `${this.fileName}.js`;
31
+ return fileName;
32
+ }
33
+ shouldAddHash(hashConfig) {
34
+ if (typeof hashConfig === 'undefined') {
35
+ return true;
36
+ }
37
+ if (typeof hashConfig.js !== 'undefined'
38
+ && hashConfig.js === false
39
+ || hashConfig === false) {
40
+ return false;
41
+ }
42
+ return true;
43
+ }
44
+ }
45
+ exports.Output = Output;
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Plugins = void 0;
4
- class Plugins {
5
- constructor(plugins = []) {
6
- this.plugins = [];
7
- this.plugins = this.plugins.concat(plugins);
8
- }
9
- addPlugin(plugin) {
10
- this.plugins.push(plugin);
11
- }
12
- getPlugins() {
13
- return this.plugins;
14
- }
15
- }
16
- exports.Plugins = Plugins;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Plugins = void 0;
4
+ class Plugins {
5
+ constructor(plugins = []) {
6
+ this.plugins = [];
7
+ this.plugins = this.plugins.concat(plugins);
8
+ }
9
+ addPlugin(plugin) {
10
+ this.plugins.push(plugin);
11
+ }
12
+ getPlugins() {
13
+ return this.plugins;
14
+ }
15
+ }
16
+ exports.Plugins = Plugins;
@@ -1,47 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JavascriptPreset = void 0;
4
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
- class JavascriptPreset {
6
- getPlugins(filename) {
7
- return [
8
- new MiniCssExtractPlugin({
9
- filename
10
- })
11
- ];
12
- }
13
- getModule() {
14
- return {
15
- rules: [
16
- {
17
- test: /\.css$/,
18
- use: [
19
- MiniCssExtractPlugin.loader,
20
- 'css-loader'
21
- ],
22
- },
23
- {
24
- test: /\.scss$/,
25
- use: [
26
- MiniCssExtractPlugin.loader,
27
- 'css-loader',
28
- 'sass-loader'
29
- ],
30
- },
31
- {
32
- test: /\.jsx?$/,
33
- loader: 'babel-loader',
34
- exclude: /node_modules\/(?!@studyportals\/).*/
35
- }
36
- ]
37
- };
38
- }
39
- getExtensions() {
40
- return [
41
- '*',
42
- '.js',
43
- '.json'
44
- ];
45
- }
46
- }
47
- exports.JavascriptPreset = JavascriptPreset;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JavascriptPreset = void 0;
4
+ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
+ class JavascriptPreset {
6
+ getPlugins(filename) {
7
+ return [
8
+ new MiniCssExtractPlugin({
9
+ filename
10
+ })
11
+ ];
12
+ }
13
+ getModule() {
14
+ return {
15
+ rules: [
16
+ {
17
+ test: /\.css$/,
18
+ use: [
19
+ MiniCssExtractPlugin.loader,
20
+ 'css-loader'
21
+ ],
22
+ },
23
+ {
24
+ test: /\.scss$/,
25
+ use: [
26
+ MiniCssExtractPlugin.loader,
27
+ 'css-loader',
28
+ 'sass-loader'
29
+ ],
30
+ },
31
+ {
32
+ test: /\.jsx?$/,
33
+ loader: 'babel-loader',
34
+ exclude: /node_modules\/(?!@studyportals\/).*/
35
+ }
36
+ ]
37
+ };
38
+ }
39
+ getExtensions() {
40
+ return [
41
+ '*',
42
+ '.js',
43
+ '.json'
44
+ ];
45
+ }
46
+ }
47
+ exports.JavascriptPreset = JavascriptPreset;
@@ -1,71 +1,71 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TypeScriptPreset = void 0;
4
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
- class TypeScriptPreset {
6
- getPlugins(filename) {
7
- return [
8
- new MiniCssExtractPlugin({
9
- filename
10
- })
11
- ];
12
- }
13
- getModule() {
14
- return {
15
- rules: [
16
- {
17
- test: /\.css$/,
18
- use: [
19
- MiniCssExtractPlugin.loader,
20
- 'css-loader'
21
- ],
22
- },
23
- {
24
- test: /\.scss$/,
25
- use: [
26
- MiniCssExtractPlugin.loader,
27
- 'css-loader',
28
- 'sass-loader'
29
- ],
30
- },
31
- {
32
- test: /\.tsx?$/,
33
- exclude: /node_modules\/(?!@studyportals\/).*/,
34
- use: [
35
- {
36
- loader: 'babel-loader',
37
- },
38
- {
39
- loader: 'ts-loader'
40
- }
41
- ],
42
- },
43
- {
44
- test: /\.js$/,
45
- exclude: /node_modules\/(?!@studyportals\/).*/,
46
- use: [
47
- {
48
- loader: 'babel-loader',
49
- }
50
- ]
51
- },
52
- {
53
- test: /\.(png|jpg|gif|svg)$/,
54
- loader: 'file-loader',
55
- options: {
56
- name: '[name].[ext]?[fullhash]'
57
- }
58
- }
59
- ]
60
- };
61
- }
62
- getExtensions() {
63
- return [
64
- '*',
65
- '.ts',
66
- '.js',
67
- '.json'
68
- ];
69
- }
70
- }
71
- exports.TypeScriptPreset = TypeScriptPreset;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeScriptPreset = void 0;
4
+ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5
+ class TypeScriptPreset {
6
+ getPlugins(filename) {
7
+ return [
8
+ new MiniCssExtractPlugin({
9
+ filename
10
+ })
11
+ ];
12
+ }
13
+ getModule() {
14
+ return {
15
+ rules: [
16
+ {
17
+ test: /\.css$/,
18
+ use: [
19
+ MiniCssExtractPlugin.loader,
20
+ 'css-loader'
21
+ ],
22
+ },
23
+ {
24
+ test: /\.scss$/,
25
+ use: [
26
+ MiniCssExtractPlugin.loader,
27
+ 'css-loader',
28
+ 'sass-loader'
29
+ ],
30
+ },
31
+ {
32
+ test: /\.tsx?$/,
33
+ exclude: /node_modules\/(?!@studyportals\/).*/,
34
+ use: [
35
+ {
36
+ loader: 'babel-loader',
37
+ },
38
+ {
39
+ loader: 'ts-loader'
40
+ }
41
+ ],
42
+ },
43
+ {
44
+ test: /\.js$/,
45
+ exclude: /node_modules\/(?!@studyportals\/).*/,
46
+ use: [
47
+ {
48
+ loader: 'babel-loader',
49
+ }
50
+ ]
51
+ },
52
+ {
53
+ test: /\.(png|jpg|gif|svg)$/,
54
+ loader: 'file-loader',
55
+ options: {
56
+ name: '[name].[ext]?[fullhash]'
57
+ }
58
+ }
59
+ ]
60
+ };
61
+ }
62
+ getExtensions() {
63
+ return [
64
+ '*',
65
+ '.ts',
66
+ '.js',
67
+ '.json'
68
+ ];
69
+ }
70
+ }
71
+ exports.TypeScriptPreset = TypeScriptPreset;
@@ -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;