@studyportals/webpack-helper 2.4.3 → 3.0.0-beta.3
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/README.md +201 -201
- package/assets/.babelrc +10 -10
- package/assets/.browserslistrc +2 -2
- package/package.json +58 -58
- package/src/defaults/development.config.js +8 -7
- package/src/defaults/production.config.js +61 -58
- package/src/enums/mode.js +8 -7
- package/src/enums/preset.js +9 -8
- package/src/factories/configuration-factory.js +10 -12
- package/src/interfaces/bob.interface.js +2 -2
- package/src/interfaces/entry.interface.js +2 -2
- package/src/interfaces/entrypoint.interface.js +2 -2
- package/src/interfaces/output.interface.js +2 -2
- package/src/interfaces/preset.interface.js +2 -2
- package/src/main.js +5 -5
- package/src/model/configuration.js +117 -119
- package/src/model/entry.js +12 -12
- package/src/model/module.js +17 -18
- package/src/model/output.js +45 -45
- package/src/model/plugins.js +16 -17
- package/src/presets/javascript.preset.js +47 -49
- package/src/presets/typescript.preset.js +60 -62
- package/src/presets/vue-typescript.preset.js +83 -85
package/src/model/plugins.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.plugins = [];
|
|
7
|
-
this.plugins = this.plugins.concat(plugins);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
this.plugins.push(plugin);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return this.plugins;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
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,49 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
'
|
|
43
|
-
'.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}());
|
|
49
|
-
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,62 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
'
|
|
55
|
-
'.
|
|
56
|
-
'.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}());
|
|
62
|
-
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
|
+
loader: 'ts-loader',
|
|
34
|
+
exclude: /node_modules\/(?!@studyportals\/).*/
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
test: /\.js$/,
|
|
38
|
+
loader: 'babel-loader',
|
|
39
|
+
exclude: /node_modules\/(?!@studyportals\/).*/
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
test: /\.(png|jpg|gif|svg)$/,
|
|
43
|
+
loader: 'file-loader',
|
|
44
|
+
options: {
|
|
45
|
+
name: '[name].[ext]?[hash]'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
getExtensions() {
|
|
52
|
+
return [
|
|
53
|
+
'*',
|
|
54
|
+
'.ts',
|
|
55
|
+
'.js',
|
|
56
|
+
'.json'
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.TypeScriptPreset = TypeScriptPreset;
|
|
@@ -1,85 +1,83 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
'
|
|
77
|
-
'.
|
|
78
|
-
'.
|
|
79
|
-
'.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}());
|
|
85
|
-
exports.VueTypeScriptPreset = VueTypeScriptPreset;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VueTypeScriptPreset = void 0;
|
|
4
|
+
const webpack = require("webpack");
|
|
5
|
+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
6
|
+
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
|
|
7
|
+
class VueTypeScriptPreset {
|
|
8
|
+
getPlugins(filename) {
|
|
9
|
+
return [
|
|
10
|
+
new webpack.DllReferencePlugin({
|
|
11
|
+
manifest: require("@studyportals/vue-config/dist/vue3_library.json")
|
|
12
|
+
}),
|
|
13
|
+
new MiniCssExtractPlugin({
|
|
14
|
+
filename
|
|
15
|
+
}),
|
|
16
|
+
new VueLoaderPlugin()
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
getModule() {
|
|
20
|
+
return {
|
|
21
|
+
rules: [
|
|
22
|
+
{
|
|
23
|
+
test: /\.css$/,
|
|
24
|
+
use: [
|
|
25
|
+
MiniCssExtractPlugin.loader,
|
|
26
|
+
'css-loader'
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
test: /\.scss$/,
|
|
31
|
+
use: [
|
|
32
|
+
MiniCssExtractPlugin.loader,
|
|
33
|
+
'css-loader',
|
|
34
|
+
'sass-loader'
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
test: /\.vue$/,
|
|
39
|
+
loader: 'vue-loader',
|
|
40
|
+
options: {
|
|
41
|
+
loaders: {
|
|
42
|
+
'scss': [
|
|
43
|
+
'vue-style-loader',
|
|
44
|
+
'css-loader',
|
|
45
|
+
'sass-loader'
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
test: /\.tsx?$/,
|
|
52
|
+
loader: 'ts-loader',
|
|
53
|
+
exclude: /node_modules\/(?!@studyportals\/).*/,
|
|
54
|
+
options: {
|
|
55
|
+
appendTsSuffixTo: [/\.vue$/]
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
test: /\.js$/,
|
|
60
|
+
loader: 'babel-loader',
|
|
61
|
+
exclude: /node_modules\/(?!@studyportals\/).*/
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
test: /\.(png|jpg|gif|svg)$/,
|
|
65
|
+
loader: 'file-loader',
|
|
66
|
+
options: {
|
|
67
|
+
name: '[name].[ext]?[hash]'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
getExtensions() {
|
|
74
|
+
return [
|
|
75
|
+
'*',
|
|
76
|
+
'.ts',
|
|
77
|
+
'.js',
|
|
78
|
+
'.vue',
|
|
79
|
+
'.json'
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.VueTypeScriptPreset = VueTypeScriptPreset;
|