@ovh-ux/manager-webpack-config 6.0.1 → 6.1.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/CHANGELOG.md +11 -0
- package/package.json +2 -1
- package/src/loaders/html-minifier.js +19 -0
- package/src/webpack.common.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [6.1.0](https://github.com/ovh/manager/compare/@ovh-ux/manager-webpack-config@6.0.1...@ovh-ux/manager-webpack-config@6.1.0) (2023-01-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **webpack:** add html minifier in webpack config ([45a14a9](https://github.com/ovh/manager/commit/45a14a96bb06fe3063bd4f1ca5135f3eb8e2572d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [6.0.1](https://github.com/ovh/manager/compare/@ovh-ux/manager-webpack-config@6.0.0...@ovh-ux/manager-webpack-config@6.0.1) (2022-11-29)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @ovh-ux/manager-webpack-config
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovh-ux/manager-webpack-config",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "OVHcloud manager shared webpack configuration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"configuration",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"core-js": "^3.6.5",
|
|
42
42
|
"css-loader": "^4.3.0",
|
|
43
43
|
"file-loader": "^4.0.0",
|
|
44
|
+
"html-minifier": "^4.0.0",
|
|
44
45
|
"html-webpack-plugin": "^4.5.0",
|
|
45
46
|
"http-proxy-middleware": "^0.19.1",
|
|
46
47
|
"less": "~3.9.0",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { minify } = require('html-minifier');
|
|
2
|
+
// see : https://github.com/kangax/html-minifier
|
|
3
|
+
|
|
4
|
+
module.exports = function translationsJson(source) {
|
|
5
|
+
if (this.mode !== 'production') {
|
|
6
|
+
return source;
|
|
7
|
+
}
|
|
8
|
+
return minify(source, {
|
|
9
|
+
continueOnParseError: true,
|
|
10
|
+
collapseBooleanAttributes: true,
|
|
11
|
+
collapseWhitespace: true,
|
|
12
|
+
removeAttributeQuotes: true,
|
|
13
|
+
removeComments: true,
|
|
14
|
+
removeRedundantAttributes: true,
|
|
15
|
+
removeScriptTypeAttributes: true,
|
|
16
|
+
removeStyleLinkTypeAttributes: true,
|
|
17
|
+
useShortDoctype: true,
|
|
18
|
+
});
|
|
19
|
+
};
|
package/src/webpack.common.js
CHANGED
|
@@ -104,7 +104,14 @@ module.exports = (opts) => {
|
|
|
104
104
|
// load HTML files as string (raw-loader)
|
|
105
105
|
{
|
|
106
106
|
test: /\.html$/,
|
|
107
|
-
|
|
107
|
+
use: [
|
|
108
|
+
{
|
|
109
|
+
loader: 'raw-loader',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
loader: path.resolve(__dirname, './loaders/html-minifier.js'),
|
|
113
|
+
},
|
|
114
|
+
],
|
|
108
115
|
},
|
|
109
116
|
|
|
110
117
|
// load images & fonts into file or convert to base64 if size < 10Kib
|