@studyportals/webpack-helper 3.0.6 → 3.2.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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/webpack-helper",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "A collection of standard configurations and helpers for webpack.",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"@studyportals/bob-manifest-generator": "^3.0.0",
|
|
32
32
|
"@studyportals/browserslist-config": "^1.2.0",
|
|
33
33
|
"@studyportals/dll-availability-tracker": "^2.0.0",
|
|
34
|
-
"@studyportals/vue-config": "^4.
|
|
34
|
+
"@studyportals/vue-config": "^4.1.0",
|
|
35
35
|
"babel-loader": "^8.2.3",
|
|
36
36
|
"css-loader": "^6.5.1",
|
|
37
37
|
"file-loader": "^6.2.0",
|
|
38
38
|
"mini-css-extract-plugin": "^2.5.3",
|
|
39
|
-
"
|
|
39
|
+
"css-minimizer-webpack-plugin": "^4.0.0",
|
|
40
40
|
"path": "^0.12.7",
|
|
41
41
|
"sass": "^1.49.7",
|
|
42
42
|
"sass-loader": "^12.4.0",
|
|
43
43
|
"terser-webpack-plugin": "^5.3.1",
|
|
44
44
|
"ts-loader": "^9.2.6",
|
|
45
|
-
"typescript": "^
|
|
45
|
+
"typescript": "^4.7.4",
|
|
46
46
|
"vue-loader": "^16.2.0",
|
|
47
47
|
"webpack": "^5.68.0",
|
|
48
48
|
"webpack-cli": "^4.9.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/jest": "^27.4.0",
|
|
53
53
|
"@types/node": "^17.0.14",
|
|
54
54
|
"babel-jest": "^25.1.0",
|
|
55
|
-
"jest": "^
|
|
56
|
-
"ts-jest": "^
|
|
55
|
+
"jest": "^28.1.1",
|
|
56
|
+
"ts-jest": "^28.0.5"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProductionConfig = void 0;
|
|
4
4
|
const webpack = require('webpack');
|
|
5
|
-
const
|
|
5
|
+
const cssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
|
6
6
|
const DllAvailabilityTracker = require('@studyportals/dll-availability-tracker');
|
|
7
|
-
|
|
7
|
+
const ProductionConfig = (bobConfig) => {
|
|
8
8
|
let dllDependencies = ['library'];
|
|
9
9
|
if (bobConfig && bobConfig.hasOwnProperty('dllPackages')) {
|
|
10
10
|
bobConfig.dllPackages.forEach((dependency) => dllDependencies.push(dependency.manifest.name));
|
|
@@ -19,7 +19,7 @@ exports.ProductionConfig = (bobConfig) => {
|
|
|
19
19
|
NODE_ENV: '"production"'
|
|
20
20
|
}
|
|
21
21
|
}),
|
|
22
|
-
new
|
|
22
|
+
new cssMinimizerPlugin({
|
|
23
23
|
cssProcessorPluginOptions: {
|
|
24
24
|
preset: [
|
|
25
25
|
'default',
|
|
@@ -59,3 +59,4 @@ exports.ProductionConfig = (bobConfig) => {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
+
exports.ProductionConfig = ProductionConfig;
|
|
@@ -31,8 +31,9 @@ class Configuration {
|
|
|
31
31
|
const configPrd = options[mode_1.Mode.PRODUCTION] ? options[mode_1.Mode.PRODUCTION] : {};
|
|
32
32
|
this.environmentSpecificConfig = {
|
|
33
33
|
[mode_1.Mode.DEVELOPMENT]: merge([configDev, development_config_1.DevelopmentConfig]) || development_config_1.DevelopmentConfig,
|
|
34
|
-
[mode_1.Mode.PRODUCTION]: merge([configPrd, production_config_1.ProductionConfig(this.bob)]) || production_config_1.ProductionConfig(this.bob)
|
|
34
|
+
[mode_1.Mode.PRODUCTION]: merge([configPrd, (0, production_config_1.ProductionConfig)(this.bob)]) || (0, production_config_1.ProductionConfig)(this.bob)
|
|
35
35
|
};
|
|
36
|
+
this.fileName = options.output.fileName || "[name]";
|
|
36
37
|
}
|
|
37
38
|
get(mode) {
|
|
38
39
|
this.detectPresets(mode);
|
|
@@ -112,12 +113,13 @@ class Configuration {
|
|
|
112
113
|
return dependencies;
|
|
113
114
|
}
|
|
114
115
|
getCSSFileName() {
|
|
116
|
+
const fileName = this.fileName || `style`;
|
|
115
117
|
if (this.hash === false
|
|
116
118
|
|| typeof this.hash.css !== 'undefined'
|
|
117
119
|
&& this.hash.css === false) {
|
|
118
|
-
return
|
|
120
|
+
return `${fileName}.css`;
|
|
119
121
|
}
|
|
120
|
-
return
|
|
122
|
+
return `${fileName}.[fullhash].css`;
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
exports.Configuration = Configuration;
|