weboptimizer 2.0.1168 → 2.0.1169

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "2.0.1168",
3
+ "version": "2.0.1169",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -923,10 +923,17 @@
923
923
  },
924
924
  "cssnano": {
925
925
  "#": "The autoprefixer has to be disabled in this context since it would remove all needed vendor prefixes from the preceding processing (every prefix should be needed here).",
926
- "autoprefixer": false,
927
- "discardUnused": {
928
- "__evaluate__": "!self.library"
929
- }
926
+ "preset": [
927
+ {
928
+ "__evaluate__": "require('cssnano-preset-default')"
929
+ },
930
+ {
931
+ "autoprefixer": false,
932
+ "discardUnused": {
933
+ "__evaluate__": "!self.library"
934
+ }
935
+ }
936
+ ]
930
937
  },
931
938
  "data": {
932
939
  "exclude": null,
@@ -54,7 +54,8 @@ var _helper = _interopRequireDefault(require("./helper"));
54
54
 
55
55
  var _ejsLoader = _interopRequireDefault(require("./ejsLoader"));
56
56
 
57
- var _this = void 0,
57
+ var _optionalRequire,
58
+ _this = void 0,
58
59
  _configuration$path$c,
59
60
  _configuration$cache,
60
61
  _configuration$cache2,
@@ -78,6 +79,7 @@ var postcssCSSnano = (0, _clientnode.optionalRequire)('cssnano');
78
79
  var postcssFontpath = (0, _clientnode.optionalRequire)('postcss-fontpath');
79
80
  var postcssImport = (0, _clientnode.optionalRequire)('postcss-import');
80
81
  var postcssSprites = (0, _clientnode.optionalRequire)('postcss-sprites');
82
+ var updateRule = (_optionalRequire = (0, _clientnode.optionalRequire)('postcss-sprites/lib/core')) === null || _optionalRequire === void 0 ? void 0 : _optionalRequire.updateRule;
81
83
  var postcssURL = (0, _clientnode.optionalRequire)('postcss-url');
82
84
  var pluginNameResourceMapping = {
83
85
  HTML: 'html-webpack-plugin',
@@ -897,10 +899,20 @@ var cssUse = _module.preprocessor.cascadingStyleSheet.additional.pre.map(evaluat
897
899
  onSaveSpritesheet: function onSaveSpritesheet(image) {
898
900
  return (0, _path.join)(image.spritePath, (0, _path.relative)(configuration.path.target.asset.image, configuration.files.compose.image));
899
901
  },
900
- // TODO
901
- onUpdateRule: function onUpdateRule(rule, declaration, output) {
902
- console.log('u', declaration.value, declaration.text);
903
- return output;
902
+
903
+ /*
904
+ Reset this token due to a
905
+ sprite bug with
906
+ "background-image" declaration
907
+ which do not refer to an image
908
+ (e.g. linear gradient instead).
909
+ */
910
+ onUpdateRule: function onUpdateRule(rule, token, image) {
911
+ if (token.value.includes(token.text)) updateRule(rule, token, image);else token.cloneAfter({
912
+ type: 'decl',
913
+ prop: 'background-image',
914
+ value: token.value
915
+ });
904
916
  }
905
917
  },
906
918
  stylesheetPath: configuration.path.source.asset.cascadingStyleSheet,