gatsby-plugin-image 2.0.0 → 2.1.0
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/CHANGELOG.md +0 -6
- package/dist/babel-helpers.js +66 -66
- package/dist/babel-plugin-parse-static-images.js +80 -80
- package/dist/components/gatsby-image.browser.js +247 -246
- package/dist/components/gatsby-image.server.js +112 -112
- package/dist/components/hooks.js +399 -399
- package/dist/components/intersection-observer.js +55 -55
- package/dist/components/layout-wrapper.js +94 -94
- package/dist/components/lazy-hydrate.js +75 -75
- package/dist/components/main-image.js +43 -43
- package/dist/components/picture.js +96 -96
- package/dist/components/placeholder.js +74 -74
- package/dist/components/static-image.server.js +111 -111
- package/dist/gatsby-image.browser.js +1 -1
- package/dist/gatsby-image.browser.modern.js +1 -1
- package/dist/gatsby-image.browser.module.js +1 -1
- package/dist/gatsby-node.js +54 -54
- package/dist/image-utils.js +449 -449
- package/dist/index.browser-44f85d35.js +2 -0
- package/dist/{index.browser-6dd13747.js.map → index.browser-44f85d35.js.map} +1 -1
- package/dist/index.browser-47dabe93.js +2 -0
- package/dist/{index.browser-38b528ec.js.map → index.browser-47dabe93.js.map} +1 -1
- package/dist/{index.browser-6dd13747.js → index.browser-aa98ba4b.js} +3 -3
- package/dist/{index.browser-bb1a9c70.js.map → index.browser-aa98ba4b.js.map} +1 -1
- package/dist/index.js +27 -27
- package/dist/{lazy-hydrate-9c85febc.js → lazy-hydrate-20d22952.js} +2 -2
- package/dist/{lazy-hydrate-9c85febc.js.map → lazy-hydrate-20d22952.js.map} +1 -1
- package/dist/{lazy-hydrate-3976826a.js → lazy-hydrate-5c228ac8.js} +2 -2
- package/dist/{lazy-hydrate-3976826a.js.map → lazy-hydrate-5c228ac8.js.map} +1 -1
- package/dist/{lazy-hydrate-5042e462.js → lazy-hydrate-85a67a95.js} +2 -2
- package/dist/{lazy-hydrate-5042e462.js.map → lazy-hydrate-85a67a95.js.map} +1 -1
- package/dist/node-apis/image-processing.js +278 -278
- package/dist/node-apis/node-utils.js +11 -11
- package/dist/node-apis/parser.js +98 -98
- package/dist/node-apis/preprocess-source.js +118 -118
- package/dist/node-apis/watcher.js +129 -129
- package/dist/resolver-utils.js +119 -119
- package/dist/src/babel-helpers.d.ts +6 -6
- package/dist/src/babel-plugin-parse-static-images.d.ts +10 -10
- package/dist/src/components/gatsby-image.browser.d.ts.map +1 -1
- package/dist/src/gatsby-node.d.ts +5 -5
- package/dist/src/gatsby-ssr.d.ts.map +1 -1
- package/dist/src/node-apis/image-processing.d.ts +30 -30
- package/dist/src/node-apis/node-utils.d.ts +1 -1
- package/dist/src/node-apis/parser.d.ts +11 -11
- package/dist/src/node-apis/preprocess-source.d.ts +2 -2
- package/dist/src/node-apis/watcher.d.ts +12 -12
- package/dist/src/resolver-utils.d.ts +21 -21
- package/gatsby-ssr.js +1 -1
- package/package.json +4 -4
- package/dist/index.browser-38b528ec.js +0 -2
- package/dist/index.browser-bb1a9c70.js +0 -2
package/dist/gatsby-node.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
exports.__esModule = true;
|
|
13
|
-
exports.onCreateWebpackConfig = exports.onCreateBabelConfig = exports.createSchemaCustomization = void 0;
|
|
14
|
-
var node_utils_1 = require("./node-apis/node-utils");
|
|
15
|
-
var resolver_utils_1 = require("./resolver-utils");
|
|
16
|
-
__exportStar(require("./node-apis/preprocess-source"), exports);
|
|
17
|
-
var createSchemaCustomization = function (_a) {
|
|
18
|
-
var actions = _a.actions, schema = _a.schema;
|
|
19
|
-
actions.createTypes([
|
|
20
|
-
schema.buildEnumType(resolver_utils_1.ImageFormatType),
|
|
21
|
-
schema.buildEnumType(resolver_utils_1.ImageLayoutType),
|
|
22
|
-
schema.buildEnumType(resolver_utils_1.ImagePlaceholderType),
|
|
23
|
-
]);
|
|
24
|
-
};
|
|
25
|
-
exports.createSchemaCustomization = createSchemaCustomization;
|
|
26
|
-
var onCreateBabelConfig = function (_a) {
|
|
27
|
-
var actions = _a.actions, store = _a.store;
|
|
28
|
-
var root = store.getState().program.directory;
|
|
29
|
-
var cacheDir = (0, node_utils_1.getCacheDir)(root);
|
|
30
|
-
actions.setBabelPlugin({
|
|
31
|
-
name: require.resolve("./babel-plugin-parse-static-images"),
|
|
32
|
-
options: {
|
|
33
|
-
cacheDir: cacheDir
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
exports.onCreateBabelConfig = onCreateBabelConfig;
|
|
38
|
-
var onCreateWebpackConfig = function (_a) {
|
|
39
|
-
var stage = _a.stage, plugins = _a.plugins, actions = _a.actions;
|
|
40
|
-
if (stage !== "develop" &&
|
|
41
|
-
stage !== "build-javascript" &&
|
|
42
|
-
stage !== "build-html") {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
actions.setWebpackConfig({
|
|
46
|
-
plugins: [
|
|
47
|
-
plugins.define({
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
49
|
-
GATSBY___IMAGE: true
|
|
50
|
-
}),
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
exports.onCreateWebpackConfig = onCreateWebpackConfig;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
exports.__esModule = true;
|
|
13
|
+
exports.onCreateWebpackConfig = exports.onCreateBabelConfig = exports.createSchemaCustomization = void 0;
|
|
14
|
+
var node_utils_1 = require("./node-apis/node-utils");
|
|
15
|
+
var resolver_utils_1 = require("./resolver-utils");
|
|
16
|
+
__exportStar(require("./node-apis/preprocess-source"), exports);
|
|
17
|
+
var createSchemaCustomization = function (_a) {
|
|
18
|
+
var actions = _a.actions, schema = _a.schema;
|
|
19
|
+
actions.createTypes([
|
|
20
|
+
schema.buildEnumType(resolver_utils_1.ImageFormatType),
|
|
21
|
+
schema.buildEnumType(resolver_utils_1.ImageLayoutType),
|
|
22
|
+
schema.buildEnumType(resolver_utils_1.ImagePlaceholderType),
|
|
23
|
+
]);
|
|
24
|
+
};
|
|
25
|
+
exports.createSchemaCustomization = createSchemaCustomization;
|
|
26
|
+
var onCreateBabelConfig = function (_a) {
|
|
27
|
+
var actions = _a.actions, store = _a.store;
|
|
28
|
+
var root = store.getState().program.directory;
|
|
29
|
+
var cacheDir = (0, node_utils_1.getCacheDir)(root);
|
|
30
|
+
actions.setBabelPlugin({
|
|
31
|
+
name: require.resolve("./babel-plugin-parse-static-images"),
|
|
32
|
+
options: {
|
|
33
|
+
cacheDir: cacheDir
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.onCreateBabelConfig = onCreateBabelConfig;
|
|
38
|
+
var onCreateWebpackConfig = function (_a) {
|
|
39
|
+
var stage = _a.stage, plugins = _a.plugins, actions = _a.actions;
|
|
40
|
+
if (stage !== "develop" &&
|
|
41
|
+
stage !== "build-javascript" &&
|
|
42
|
+
stage !== "build-html") {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
actions.setWebpackConfig({
|
|
46
|
+
plugins: [
|
|
47
|
+
plugins.define({
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
49
|
+
GATSBY___IMAGE: true
|
|
50
|
+
}),
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.onCreateWebpackConfig = onCreateWebpackConfig;
|