weboptimizer 4.0.105-1 → 4.0.105

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.
Files changed (2) hide show
  1. package/dist/ejsLoader.js +22 -33
  2. package/package.json +13 -7
package/dist/ejsLoader.js CHANGED
@@ -110,39 +110,28 @@ export const loader = async function (source) {
110
110
  }
111
111
  throw new Error(`Given template file "${template}" couldn't be resolved.`);
112
112
  };
113
- const compressHTML = content => {
114
- const minifierOptions = extend(true, {
115
- caseSensitive: true,
116
- collapseInlineTagWhitespace: true,
117
- collapseWhitespace: true,
118
- conservativeCollapse: true,
119
- minifyCSS: true,
120
- minifyJS: true,
121
- processScripts: ['text/ng-template', 'text/x-handlebars-template'],
122
- removeAttributeQuotes: true,
123
- removeComments: true,
124
- removeDefaultTypeAttributes: true,
125
- removeRedundantAttributes: true,
126
- sortAttributes: true,
127
- sortClassNames: true,
128
- // NOTE: Avoids whitespace around placeholder in tags.
129
- trimCustomFragments: true,
130
- useShortDoctype: true
131
- }, givenOptions.compress?.html || {});
113
+ const compressHTML = content => minifyHTML(content, extend(true, {
114
+ caseSensitive: true,
115
+ collapseInlineTagWhitespace: true,
116
+ collapseWhitespace: true,
117
+ conservativeCollapse: true,
118
+ minifyCSS: true,
119
+ minifyJS: true,
120
+ processScripts: ['text/ng-template', 'text/x-handlebars-template'],
121
+ removeAttributeQuotes: true,
122
+ removeComments: true,
123
+ removeRedundantAttributes: true,
124
+ removeScriptTypeAttributes: true,
125
+ removeStyleLinkTypeAttributes: true,
126
+ sortAttributes: true,
127
+ sortClassName: true,
132
128
  /*
133
- NOTE: Given options are shared with "html-webpack-plugin" and
134
- "html-loader" which are based on "html-minifier-terser" so we
135
- have to map its option names to "html-minifier".
129
+ NOTE: Avoids whitespace around placeholder in
130
+ tags.
136
131
  */
137
- const renamedOptions = {};
138
- for (const [oldName, newName] of [['removeScriptTypeAttributes', 'removeDefaultTypeAttributes'], ['removeStyleLinkTypeAttributes', 'removeDefaultTypeAttributes'], ['sortClassName', 'sortClassNames']]) if (Object.prototype.hasOwnProperty.call(minifierOptions, oldName)) {
139
- renamedOptions[newName] = Boolean(renamedOptions[newName]) || Boolean(minifierOptions[oldName]);
140
- delete minifierOptions[oldName];
141
- }
142
- Object.assign(minifierOptions, renamedOptions);
143
- for (const name of ['html5', 'processConditionalComments', 'removeCDATASectionsFromCDATA', 'removeCommentsFromCDATA']) delete minifierOptions[name];
144
- return minifyHTML(content, minifierOptions);
145
- };
132
+ trimCustomFragments: true,
133
+ useShortDoctype: true
134
+ }, givenOptions.compress?.html || {}));
146
135
  let result = template;
147
136
  const isString = Boolean(options.isString);
148
137
  delete options.isString;
@@ -176,7 +165,7 @@ export const loader = async function (source) {
176
165
  encoding
177
166
  });
178
167
  }
179
- if (step === compileSteps && givenOptions.compress?.html) result = await compressHTML(result);
168
+ if (step === compileSteps && givenOptions.compress?.html) result = compressHTML(result);
180
169
  if (step === compileSteps && compileSteps % 2) {
181
170
  /*
182
171
  We have to use the templace class directly to get
@@ -246,7 +235,7 @@ export const loader = async function (source) {
246
235
  }
247
236
  } else {
248
237
  result = await result(scope);
249
- if (givenOptions.compress?.html) result = await compressHTML(result);
238
+ if (givenOptions.compress?.html) result = compressHTML(result);
250
239
  }
251
240
  }
252
241
  if (compileSteps % 2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "4.0.105-1",
3
+ "version": "4.0.105",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -87,14 +87,14 @@
87
87
  "babel-loader": "^10.1.1",
88
88
  "babel-plugin-polyfill-corejs3": "^1.0.0",
89
89
  "babel-plugin-transform-rewrite-imports": "^1.5.4",
90
- "clientnode": "4.0.1531",
90
+ "clientnode": "4.0.1530",
91
91
  "core-js": "^3.51.0",
92
92
  "ejs": "^7.0.2",
93
93
  "exports-loader": "^5.0.0",
94
94
  "extract-loader": "^5.1.0",
95
95
  "glob-all": "^3.3.1",
96
96
  "html-loader": "^5.1.0",
97
- "html-minifier": "^5.0.1",
97
+ "html-minifier": "^4.0.0",
98
98
  "html-webpack-plugin": "^5.6.8",
99
99
  "imports-loader": "^5.0.0",
100
100
  "jest-environment-jsdom": "^30.5.2",
@@ -111,6 +111,7 @@
111
111
  "@stylistic/eslint-plugin": "^5.10.0",
112
112
  "@types/ejs": "^3.1.5",
113
113
  "@types/eslint": "^9.6.1",
114
+ "@types/html-minifier": "^4.0.6",
114
115
  "@types/html-minifier-terser": "^7.0.2",
115
116
  "@types/imagemin": "^9.0.1",
116
117
  "@types/node": "^26.6.6",
@@ -123,7 +124,7 @@
123
124
  "cssnano": "^9.9.0",
124
125
  "eslint": "^10.14.0",
125
126
  "eslint-config-google": "^0.14.0",
126
- "eslint-plugin-jsdoc": "^65.4.3",
127
+ "eslint-plugin-jsdoc": "^65.4.2",
127
128
  "favicons": "^7.3.1",
128
129
  "favicons-webpack-plugin": "^6.0.1",
129
130
  "globals": "^17.14.0",
@@ -142,18 +143,20 @@
142
143
  "postcss-url": "^10.1.4",
143
144
  "shx": "^0.4.0",
144
145
  "style-loader": "^4.0.0",
145
- "stylelint": "^18.0.0",
146
- "stylelint-config-standard": "^41.0.0",
146
+ "stylelint": "^17.16.0",
147
+ "stylelint-config-standard": "^40.0.0",
148
+ "stylelint-config-standard-scss": "^17.0.0",
147
149
  "terser-webpack-plugin": "^5.6.1",
148
150
  "typescript-eslint": "^8.72.1",
149
151
  "typescript-plugin-css-modules": "^5.3.0",
150
- "web-documentation": "^1.0.72",
152
+ "web-documentation": "^1.0.71",
151
153
  "workbox-webpack-plugin": "^7.4.1"
152
154
  },
153
155
  "peerDependencies": {
154
156
  "@babel/eslint-parser": "*",
155
157
  "@eslint/js": "*",
156
158
  "@types/ejs": "*",
159
+ "@types/html-minifier": "*",
157
160
  "@types/imagemin": "*",
158
161
  "@types/node": "*",
159
162
  "@types/webpack-env": "*",
@@ -198,6 +201,9 @@
198
201
  "@types/ejs": {
199
202
  "optional": true
200
203
  },
204
+ "@types/html-minifier": {
205
+ "optional": true
206
+ },
201
207
  "@types/imagemin": {
202
208
  "optional": true
203
209
  },