@rsbuild/plugin-image-compress 0.1.2 → 0.1.4

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { RsbuildPlugin } from '@rsbuild/webpack';
1
+ import { RsbuildPlugin } from '@rsbuild/core';
2
2
  import { JpegCompressOptions, PngQuantOptions, PNGLosslessOptions } from '@napi-rs/image';
3
3
  import { Config } from 'svgo';
4
4
 
package/dist/index.js CHANGED
@@ -120,9 +120,9 @@ ${cause.message}` : cause.message;
120
120
  }
121
121
  const opts = { ...codec.defaultOptions, ...this.options };
122
122
  const handleAsset = async (name) => {
123
- var _a;
124
- const info = (_a = compilation.getAsset(name)) == null ? void 0 : _a.info;
125
- if ((info == null ? void 0 : info.minimized) || !matchObject(opts, name)) {
123
+ const info = compilation.getAsset(name)?.info;
124
+ const fileName = name.split("?")[0];
125
+ if (info?.minimized || !matchObject(opts, fileName)) {
126
126
  return;
127
127
  }
128
128
  const { source: inputSource } = compilation.getAsset(name);
package/dist/index.mjs CHANGED
@@ -99,7 +99,8 @@ ${cause.message}` : cause.message;
99
99
  const opts = { ...codec.defaultOptions, ...this.options };
100
100
  const handleAsset = async (name) => {
101
101
  const info = compilation.getAsset(name)?.info;
102
- if (info?.minimized || !matchObject(opts, name)) {
102
+ const fileName = name.split("?")[0];
103
+ if (info?.minimized || !matchObject(opts, fileName)) {
103
104
  return;
104
105
  }
105
106
  const { source: inputSource } = compilation.getAsset(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-image-compress",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Image compress plugin for Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -24,15 +24,15 @@
24
24
  "dependencies": {
25
25
  "@napi-rs/image": "^1.7.0",
26
26
  "svgo": "^3.0.2",
27
- "@rsbuild/shared": "0.1.2"
27
+ "@rsbuild/shared": "0.1.4"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^16",
31
31
  "typescript": "^5.3.0",
32
32
  "webpack": "^5.89.0",
33
- "@rsbuild/test-helper": "0.1.2",
34
- "@rsbuild/webpack": "0.1.2",
35
- "@rsbuild/core": "0.1.2"
33
+ "@rsbuild/core": "0.1.4",
34
+ "@rsbuild/webpack": "0.1.4",
35
+ "@rsbuild/test-helper": "0.1.4"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public",