gatsby-plugin-image 3.3.0 → 3.3.2

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.
@@ -38,7 +38,9 @@ function attrs(_a) {
38
38
  console.warn("[gatsby-plugin-image] ".concat(error));
39
39
  }
40
40
  // Adding the filename to the hashing, like in "extractStaticImageProps" function
41
- props.filename = state.filename;
41
+ if (state.filename) {
42
+ props.filename = (0, gatsby_core_utils_1.slash)(state.filename);
43
+ }
42
44
  var hash = (0, babel_helpers_1.hashOptions)(props);
43
45
  var cacheDir = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.cacheDir;
44
46
  if (!cacheDir) {
@@ -17,6 +17,7 @@ exports.__esModule = true;
17
17
  exports.extractStaticImageProps = exports.babelParseToAst = exports.getBabelParserOptions = void 0;
18
18
  var traverse_1 = __importDefault(require("@babel/traverse"));
19
19
  var parser_1 = require("@babel/parser");
20
+ var gatsby_core_utils_1 = require("gatsby-core-utils");
20
21
  var babel_helpers_1 = require("../babel-helpers");
21
22
  var PARSER_OPTIONS = {
22
23
  allowImportExportEverywhere: true,
@@ -92,7 +93,8 @@ var extractStaticImageProps = function (ast, filename, onError) {
92
93
  nodePath, onError);
93
94
  // When the image props are the same for multiple StaticImage but they are in different locations
94
95
  // the hash will be the same then. We need to make sure that the hash is unique.
95
- image.filename = filename;
96
+ // The filename should already be normalized but better safe than sorry.
97
+ image.filename = (0, gatsby_core_utils_1.slash)(filename);
96
98
  images.set((0, babel_helpers_1.hashOptions)(image), image);
97
99
  }
98
100
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-plugin-image",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "scripts": {
5
5
  "build": "npm-run-all --npm-path npm -s clean -p build:*",
6
6
  "postbuild": "prepend-directive --files=dist/gatsby-image.browser.js,dist/gatsby-image.browser.modern.js --directive=\"use client\"",
@@ -87,13 +87,13 @@
87
87
  "@babel/runtime": "^7.15.4",
88
88
  "@babel/traverse": "^7.15.4",
89
89
  "babel-jsx-utils": "^1.1.0",
90
- "babel-plugin-remove-graphql-queries": "^5.3.0",
90
+ "babel-plugin-remove-graphql-queries": "^5.3.1",
91
91
  "camelcase": "^5.3.1",
92
92
  "chokidar": "^3.5.3",
93
93
  "common-tags": "^1.8.2",
94
94
  "fs-extra": "^10.1.0",
95
- "gatsby-core-utils": "^4.3.0",
96
- "gatsby-plugin-utils": "^4.3.0",
95
+ "gatsby-core-utils": "^4.3.1",
96
+ "gatsby-plugin-utils": "^4.3.1",
97
97
  "objectFitPolyfill": "^2.3.5",
98
98
  "prop-types": "^15.8.1"
99
99
  },
@@ -104,5 +104,5 @@
104
104
  },
105
105
  "author": "Matt Kane <matt@gatsbyjs.com>",
106
106
  "license": "MIT",
107
- "gitHead": "b995fc2374435dd1e282a167975733a1ff3d6ad0"
107
+ "gitHead": "8fc123c97f6d9934387dec2d6e0e2ea6a8338d19"
108
108
  }