weboptimizer 4.0.83 → 4.0.84
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 +6 -6
- package/webpackConfigurator.js +27 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.84",
|
|
4
4
|
"description": "A generic web optimizer, (module) bundler and development environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"babel-loader": "^10.1.1",
|
|
107
107
|
"babel-plugin-polyfill-corejs3": "^1.0.0",
|
|
108
108
|
"babel-plugin-transform-rewrite-imports": "^1.5.4",
|
|
109
|
-
"clientnode": "4.0.
|
|
109
|
+
"clientnode": "4.0.1517",
|
|
110
110
|
"core-js": "^3.50.0",
|
|
111
111
|
"ejs": "^6.0.1",
|
|
112
112
|
"exports-loader": "^5.0.0",
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"rimraf": "^6.1.3",
|
|
121
121
|
"script-loader": "^0.7.2",
|
|
122
122
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
123
|
-
"webpack": "5.
|
|
123
|
+
"webpack": "5.111.0",
|
|
124
124
|
"webpack-cli": "^7.2.3",
|
|
125
125
|
"webpack-sources": "^3.5.1"
|
|
126
126
|
},
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"cssnano": "^9.0.4",
|
|
145
145
|
"eslint": "^10.10.0",
|
|
146
146
|
"eslint-config-google": "^0.14.0",
|
|
147
|
-
"eslint-plugin-jsdoc": "^64.
|
|
147
|
+
"eslint-plugin-jsdoc": "^64.4.0",
|
|
148
148
|
"favicons": "^7.3.1",
|
|
149
149
|
"favicons-webpack-plugin": "^6.0.1",
|
|
150
150
|
"globals": "^17.12.0",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"postcss-fontpath": "^1.0.0",
|
|
159
159
|
"postcss-import": "^17.0.0",
|
|
160
160
|
"postcss-loader": "^8.2.1",
|
|
161
|
-
"postcss-preset-env": "^11.5.
|
|
161
|
+
"postcss-preset-env": "^11.5.3",
|
|
162
162
|
"postcss-sprites": "^4.2.1",
|
|
163
163
|
"postcss-url": "^10.1.4",
|
|
164
164
|
"shx": "^0.4.0",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"terser-webpack-plugin": "^5.6.1",
|
|
170
170
|
"typescript-eslint": "^8.70.0",
|
|
171
171
|
"typescript-plugin-css-modules": "^5.2.0",
|
|
172
|
-
"web-documentation": "^1.0.
|
|
172
|
+
"web-documentation": "^1.0.55",
|
|
173
173
|
"workbox-webpack-plugin": "^7.4.1"
|
|
174
174
|
},
|
|
175
175
|
"peerDependencies": {
|
package/webpackConfigurator.js
CHANGED
|
@@ -47,7 +47,31 @@ const postcssCSSnano = (await optionalImport('cssnano'))?.default;
|
|
|
47
47
|
const postcssFontpath = (await optionalImport('postcss-fontpath'))?.default;
|
|
48
48
|
const postcssImport = (await optionalImport('postcss-import'))?.default;
|
|
49
49
|
const postcssSprites = (await optionalImport('postcss-sprites'))?.default;
|
|
50
|
-
const updateRule = (await optionalImport(
|
|
50
|
+
const updateRule = (await optionalImport(
|
|
51
|
+
/*
|
|
52
|
+
NOTE: The file extension is needed since native module resolution
|
|
53
|
+
does not support extension less specifiers.
|
|
54
|
+
*/
|
|
55
|
+
'postcss-sprites/lib/core.js'))?.default.updateRule;
|
|
56
|
+
/**
|
|
57
|
+
* Converts a legacy (postcss 7) plugin into a visitor based one which runs
|
|
58
|
+
* after all other plugins have finished.
|
|
59
|
+
*
|
|
60
|
+
* NOTE: Postcss 8 runs legacy plugins during its initial root pass which
|
|
61
|
+
* happens before any visitor based plugin (like "postcss-mixins" or
|
|
62
|
+
* "postcss-nested") had the chance to resolve its constructs. A legacy plugin
|
|
63
|
+
* would therefore see (and modify) not yet resolved declarations like mixin
|
|
64
|
+
* definitions and its modifications would get lost during their later
|
|
65
|
+
* expansion.
|
|
66
|
+
* @param transformer - Legacy plugin to defer.
|
|
67
|
+
* @returns Wrapped visitor based plugin.
|
|
68
|
+
*/
|
|
69
|
+
const deferTransformer = transformer => ({
|
|
70
|
+
postcssPlugin: transformer.postcssPlugin,
|
|
71
|
+
OnceExit: (root, {
|
|
72
|
+
result
|
|
73
|
+
}) => transformer(root, result)
|
|
74
|
+
});
|
|
51
75
|
const postcssURL = (await optionalImport('postcss-url'))?.default;
|
|
52
76
|
/// endregion
|
|
53
77
|
export const log = new Logger({
|
|
@@ -439,7 +463,7 @@ const cssUse = (await Promise.all(module.preprocessor.cascadingStyleSheet.additi
|
|
|
439
463
|
}]
|
|
440
464
|
}) : [], postcssURL ? postcssURL({
|
|
441
465
|
url: 'rebase'
|
|
442
|
-
}) : [], postcssSprites ? postcssSprites({
|
|
466
|
+
}) : [], postcssSprites ? deferTransformer(postcssSprites({
|
|
443
467
|
filterBy: () => configuration.files.compose.image ? Promise.resolve() : Promise.reject(new Error()),
|
|
444
468
|
hooks: {
|
|
445
469
|
onSaveSpritesheet: image => join(image.spritePath, relative(configuration.path.target.asset.image, configuration.files.compose.image)),
|
|
@@ -461,7 +485,7 @@ const cssUse = (await Promise.all(module.preprocessor.cascadingStyleSheet.additi
|
|
|
461
485
|
stylesheetPath: configuration.path.source.asset.cascadingStyleSheet,
|
|
462
486
|
spritePath: configuration.path.source.asset.image,
|
|
463
487
|
...configuration.imageSprite
|
|
464
|
-
}) : [], await Promise.all(module.preprocessor.cascadingStyleSheet.additional.plugins.post.map(createEvaluateMapper('css.postcss'))), module.optimizer.cssnano && postcssCSSnano ? postcssCSSnano(module.optimizer.cssnano) : [])
|
|
488
|
+
})) : [], await Promise.all(module.preprocessor.cascadingStyleSheet.additional.plugins.post.map(createEvaluateMapper('css.postcss'))), module.optimizer.cssnano && postcssCSSnano ? postcssCSSnano(module.optimizer.cssnano) : [])
|
|
465
489
|
}
|
|
466
490
|
} : {}, module.preprocessor.cascadingStyleSheet.options || {})
|
|
467
491
|
} : [], await Promise.all(module.preprocessor.cascadingStyleSheet.additional.post.map(createEvaluateMapper('css'))));
|