weboptimizer 4.0.13 → 4.0.15
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/ejsLoader.js +1 -0
- package/package.json +7 -8
- package/plugins/HTMLTransformation.js +1 -1
- package/webpackConfigurator.js +3 -1
package/ejsLoader.js
CHANGED
|
@@ -39,6 +39,7 @@ export const log = new Logger({
|
|
|
39
39
|
* @returns Transformed string.
|
|
40
40
|
*/
|
|
41
41
|
export const loader = async function (source) {
|
|
42
|
+
console.log('AA', this.async, this.async());
|
|
42
43
|
const callback = this.async();
|
|
43
44
|
const givenOptions = convertSubstringInPlainObject(extend(true, {
|
|
44
45
|
compiler: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.15",
|
|
4
4
|
"description": "A generic web optimizer, (module) bundler and development environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@types/html-minifier": "^4.0.6",
|
|
124
124
|
"@types/html-minifier-terser": "^7.0.2",
|
|
125
125
|
"@types/imagemin": "^9.0.1",
|
|
126
|
-
"@types/node": "^26.1.
|
|
126
|
+
"@types/node": "^26.1.1",
|
|
127
127
|
"@types/postcss-import": "^14.0.3",
|
|
128
128
|
"@types/postcss-url": "^10.0.4",
|
|
129
129
|
"@types/webpack-env": "^1.18.8",
|
|
@@ -356,7 +356,7 @@
|
|
|
356
356
|
"__evaluate__": "self.debug"
|
|
357
357
|
},
|
|
358
358
|
"EXTERNAL_EXPORT_FORMAT": {
|
|
359
|
-
"__evaluate__": "`'${self.exportFormat.external}'`"
|
|
359
|
+
"__evaluate__": "`'${self.exportFormat.external ?? self.exportFormat.self}'`"
|
|
360
360
|
},
|
|
361
361
|
"NAME": {
|
|
362
362
|
"__evaluate__": "`'${self.name}'`"
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
}
|
|
565
565
|
],
|
|
566
566
|
"watchFiles": {
|
|
567
|
-
"__evaluate__": "
|
|
567
|
+
"__evaluate__": "{paths: [], options: {cwd: self.path.target.base, ...(self.webpack.watchOptions ?? {})}}"
|
|
568
568
|
}
|
|
569
569
|
},
|
|
570
570
|
"tool": false
|
|
@@ -586,7 +586,9 @@
|
|
|
586
586
|
"globalObject": {
|
|
587
587
|
"__evaluate__": "2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2] === 'serve' ? 'window' : 'this'"
|
|
588
588
|
},
|
|
589
|
-
"self":
|
|
589
|
+
"self": {
|
|
590
|
+
"__evaluate__": "2 < self.givenCommandLineArguments.length && ['document', 'serve'].includes(self.givenCommandLineArguments[2]) ? 'window' : 'modern-module'"
|
|
591
|
+
}
|
|
590
592
|
},
|
|
591
593
|
"extensions": {
|
|
592
594
|
"file": {
|
|
@@ -1651,9 +1653,6 @@
|
|
|
1651
1653
|
]
|
|
1652
1654
|
}
|
|
1653
1655
|
},
|
|
1654
|
-
"exportFormat": {
|
|
1655
|
-
"self": "var"
|
|
1656
|
-
},
|
|
1657
1656
|
"generic": {
|
|
1658
1657
|
"isWeb": false
|
|
1659
1658
|
},
|
|
@@ -76,7 +76,7 @@ export class HTMLTransformation {
|
|
|
76
76
|
for (const loaderConfiguration of [].concat(htmlFileSpecification.template.use)) if (loaderConfiguration.options?.compileSteps && typeof loaderConfiguration.options.compileSteps === 'number') data.html = await new Promise((resolve, reject) => {
|
|
77
77
|
void ejsLoader.bind({
|
|
78
78
|
query: extend(true, Object.prototype.hasOwnProperty.call(loaderConfiguration, 'options') ? copy(loaderConfiguration.options) : {}, htmlFileSpecification.template.postCompileOptions),
|
|
79
|
-
async: (error, result) => {
|
|
79
|
+
async: () => (error, result) => {
|
|
80
80
|
if (error) reject(error);else resolve(result);
|
|
81
81
|
}
|
|
82
82
|
})(data.html);
|
package/webpackConfigurator.js
CHANGED
|
@@ -244,7 +244,9 @@ if (configuration.injection.external.modules === '__implicit__')
|
|
|
244
244
|
}
|
|
245
245
|
if (typeof result !== 'string' && Object.prototype.hasOwnProperty.call(result, 'root') && Array.isArray(result.root)) result.root = [].concat(result.root).map(name => convertToValidVariableName(name));
|
|
246
246
|
const exportFormat = Object.prototype.hasOwnProperty.call(configuration.exportFormat, 'external') ? configuration.exportFormat.external : configuration.exportFormat.self;
|
|
247
|
-
|
|
247
|
+
let reference = exportFormat === 'umd' || typeof result === 'string' ? result : result[exportFormat];
|
|
248
|
+
if (typeof reference === 'string' && ['window', 'var'].includes(exportFormat)) reference = convertToValidVariableName(reference);
|
|
249
|
+
callback(undefined, reference, exportFormat);
|
|
248
250
|
return;
|
|
249
251
|
}
|
|
250
252
|
callback();
|