@ovh-ux/manager-webpack-config 6.0.1 → 6.1.1
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 +22 -0
- package/package.json +2 -1
- package/src/loaders/html-minifier.js +19 -0
- package/src/webpack.common.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
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.1](https://github.com/ovh/manager/compare/@ovh-ux/manager-webpack-config@6.1.0...@ovh-ux/manager-webpack-config@6.1.1) (2023-01-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **webpack-config:** disable html minification ([cacfba6](https://github.com/ovh/manager/commit/cacfba65c724aba4c6c3487ec425470626af649d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [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)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **webpack:** add html minifier in webpack config ([45a14a9](https://github.com/ovh/manager/commit/45a14a96bb06fe3063bd4f1ca5135f3eb8e2572d))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## [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
29
|
|
|
8
30
|
**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.
|
|
3
|
+
"version": "6.1.1",
|
|
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,7 @@ module.exports = (opts) => {
|
|
|
104
104
|
// load HTML files as string (raw-loader)
|
|
105
105
|
{
|
|
106
106
|
test: /\.html$/,
|
|
107
|
-
loader: 'raw-loader',
|
|
107
|
+
loader: 'raw-loader', // @TODO use html-minifier after fixing ui-kit attributes incompatibilities
|
|
108
108
|
},
|
|
109
109
|
|
|
110
110
|
// load images & fonts into file or convert to base64 if size < 10Kib
|