@ecopages/image-processor 0.2.0-beta.22 → 0.2.0-beta.24
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 +3 -3
- package/src/plugin.js +5 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/image-processor",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.24",
|
|
4
4
|
"description": "Image processor, transform and optimize images for web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"image",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"directory": "packages/processors/image-processor"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@ecopages/core": "0.2.0-beta.
|
|
18
|
+
"@ecopages/core": "0.2.0-beta.24"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@ecopages/file-system": "0.2.0-beta.
|
|
21
|
+
"@ecopages/file-system": "0.2.0-beta.24",
|
|
22
22
|
"@ecopages/logger": "^0.2.3",
|
|
23
23
|
"react": "^19.2.6",
|
|
24
24
|
"react-dom": "^19.2.6",
|
package/src/plugin.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { GENERATED_BASE_PATHS } from "@ecopages/core/constants";
|
|
3
2
|
import { fileSystem } from "@ecopages/file-system";
|
|
4
3
|
import {
|
|
5
4
|
mergeProcessorOptions,
|
|
6
|
-
Processor
|
|
5
|
+
Processor,
|
|
6
|
+
resolveGeneratedPath
|
|
7
7
|
} from "@ecopages/core/plugins/processor";
|
|
8
|
+
import { isLitStaticRenderWorkerThread } from "@ecopages/core/build/lit-static-render-worker-context";
|
|
8
9
|
import { Logger } from "@ecopages/logger";
|
|
9
10
|
import { createImagePlugin, createImagePluginBundler } from "./image-plugins.js";
|
|
10
11
|
import { ImageProcessor } from "./image-processor.js";
|
|
11
12
|
import { getSourceImagePaths, loadProcessedImagesFromDisk } from "./image-runtime-state.js";
|
|
12
13
|
import { anyCaseToCamelCase } from "./utils.js";
|
|
13
|
-
function resolveGeneratedPath(type, options) {
|
|
14
|
-
const { root, module, subPath } = options;
|
|
15
|
-
const parts = [root, GENERATED_BASE_PATHS[type], module, subPath].filter(Boolean);
|
|
16
|
-
return path.join(...parts);
|
|
17
|
-
}
|
|
18
14
|
const logger = new Logger("[@ecopages/image-processor]", {
|
|
19
15
|
debug: process.env.ECOPAGES_LOGGER_DEBUG === "true"
|
|
20
16
|
});
|
|
@@ -153,7 +149,7 @@ class ImageProcessorPlugin extends Processor {
|
|
|
153
149
|
if (this.buildContributionsPrepared) {
|
|
154
150
|
return;
|
|
155
151
|
}
|
|
156
|
-
if (
|
|
152
|
+
if (isLitStaticRenderWorkerThread()) {
|
|
157
153
|
this.buildContributionsPrepared = true;
|
|
158
154
|
return;
|
|
159
155
|
}
|
|
@@ -224,7 +220,7 @@ class ImageProcessorPlugin extends Processor {
|
|
|
224
220
|
* Ensures optimized image outputs and virtual-module state exist on disk.
|
|
225
221
|
*/
|
|
226
222
|
async setup() {
|
|
227
|
-
if (
|
|
223
|
+
if (isLitStaticRenderWorkerThread()) {
|
|
228
224
|
return;
|
|
229
225
|
}
|
|
230
226
|
this.initializeProcessor();
|