wasm-image-optimization 1.4.0 → 1.4.1

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/README.md CHANGED
@@ -3,12 +3,10 @@
3
3
  WebAssembly is used to provide image transformation functionality.
4
4
 
5
5
  - Frontend
6
-
7
6
  - Next.js (Multithreading support)
8
7
  - React Router (Multithreading support)
9
8
 
10
9
  - Backend
11
-
12
10
  - Cloudflare Workers
13
11
  - Deno Deploy
14
12
  - Node.js (Multithreading support)
@@ -68,6 +66,20 @@ optimizeImageExt({
68
66
 
69
67
  ```
70
68
 
69
+ ## WebWorker on Vite
70
+
71
+ To use Vite, the following settings are required
72
+
73
+ - vite.config.ts
74
+
75
+ ```ts
76
+ import wasmImageOptimizationPlugin from "wasm-image-optimization/vite-plugin";
77
+
78
+ export default defineConfig(() => ({
79
+ plugins: [wasmImageOptimizationPlugin()],
80
+ }));
81
+ ```
82
+
71
83
  - Multi Threading
72
84
 
73
85
  ```ts
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from "vite";
2
+ declare const _default: () => Plugin[];
3
+ export default _default;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = () => {
4
+ let config;
5
+ return [
6
+ {
7
+ name: "wasm-image-optimization-serve",
8
+ apply: "serve",
9
+ config: () => {
10
+ return {
11
+ optimizeDeps: {
12
+ exclude: ["wasm-image-optimization"],
13
+ },
14
+ };
15
+ },
16
+ },
17
+ ];
18
+ };
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/vite-plugin/index.ts"],"names":[],"mappings":";;AAEA,kBAAe,GAAa,EAAE;IAC5B,IAAI,MAAsB,CAAC;IAC3B,OAAO;QACL;YACE,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO;oBACL,YAAY,EAAE;wBACZ,OAAO,EAAE,CAAC,yBAAyB,CAAC;qBACrC;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Plugin, ResolvedConfig } from \"vite\";\r\n\r\nexport default (): Plugin[] => {\r\n let config: ResolvedConfig;\r\n return [\r\n {\r\n name: \"wasm-image-optimization-serve\",\r\n apply: \"serve\",\r\n config: () => {\r\n return {\r\n optimizeDeps: {\r\n exclude: [\"wasm-image-optimization\"],\r\n },\r\n };\r\n },\r\n },\r\n ];\r\n};\r\n"]}
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from "vite";
2
+ declare const _default: () => Plugin[];
3
+ export default _default;
@@ -0,0 +1,17 @@
1
+ export default () => {
2
+ let config;
3
+ return [
4
+ {
5
+ name: "wasm-image-optimization-serve",
6
+ apply: "serve",
7
+ config: () => {
8
+ return {
9
+ optimizeDeps: {
10
+ exclude: ["wasm-image-optimization"],
11
+ },
12
+ };
13
+ },
14
+ },
15
+ ];
16
+ };
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vite-plugin/index.ts"],"names":[],"mappings":"AAEA,eAAe,GAAa,EAAE;IAC5B,IAAI,MAAsB,CAAC;IAC3B,OAAO;QACL;YACE,IAAI,EAAE,+BAA+B;YACrC,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,GAAG,EAAE;gBACX,OAAO;oBACL,YAAY,EAAE;wBACZ,OAAO,EAAE,CAAC,yBAAyB,CAAC;qBACrC;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import type { Plugin, ResolvedConfig } from \"vite\";\r\n\r\nexport default (): Plugin[] => {\r\n let config: ResolvedConfig;\r\n return [\r\n {\r\n name: \"wasm-image-optimization-serve\",\r\n apply: \"serve\",\r\n config: () => {\r\n return {\r\n optimizeDeps: {\r\n exclude: [\"wasm-image-optimization\"],\r\n },\r\n };\r\n },\r\n },\r\n ];\r\n};\r\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wasm-image-optimization",
3
3
  "description": "Optimize images with wasm on edge runtime",
4
- "version": "1.4.0",
4
+ "version": "1.4.1",
5
5
  "scripts": {
6
6
  "test": "yarn ts-node test",
7
7
  "lint:fix": "eslint --fix src/ && prettier -w src",
@@ -14,28 +14,10 @@
14
14
  "import": "./dist/esm/index.js",
15
15
  "types": "./dist/esm/index.d.ts"
16
16
  },
17
- "./next": {
18
- "types": "./dist/web-worker/index.d.ts",
19
- "browser": "./dist/web-worker/index.js",
20
- "edge-light": "./dist/esm/index.js",
21
- "node": "./dist/esm/index.js"
22
- },
23
- "./next-api": {
24
- "types": "./dist/web-worker/index.d.ts",
25
- "browser": "./dist/web-worker/index.js",
26
- "edge-light": "./dist/next/index.js",
27
- "node": "./dist/esm/index.js"
28
- },
29
17
  "./node": {
30
18
  "types": "./dist/cjs/node/index.d.ts",
31
19
  "default": "./dist/cjs/node/index.js"
32
20
  },
33
- "./vite": {
34
- "types": "./dist/vite/index.d.ts",
35
- "browser": "./dist/vite/index.js",
36
- "node": "./dist/dummy/index.js",
37
- "default": "./dist/dummy/index.js"
38
- },
39
21
  "./web-worker": {
40
22
  "types": "./dist/web-worker/index.d.ts",
41
23
  "browser": "./dist/web-worker/index.js",
@@ -67,6 +49,10 @@
67
49
  "types": "./dist/workers/index.d.ts",
68
50
  "default": "./dist/workers/index.js"
69
51
  }
52
+ },
53
+ "./vite-plugin": {
54
+ "types": "./dist/vite-plugin/index.d.ts",
55
+ "default": "./dist/vite-plugin/index.js"
70
56
  }
71
57
  },
72
58
  "typesVersions": {
@@ -74,9 +60,6 @@
74
60
  "edge": [
75
61
  "./dist/esm/index.d.ts"
76
62
  ],
77
- "next": [
78
- "./dist/web-worker/index.d.ts"
79
- ],
80
63
  "web-worker": [
81
64
  "./dist/web-worker/index.d.ts"
82
65
  ],
@@ -114,7 +97,8 @@
114
97
  "ts-node": "^10.9.2",
115
98
  "tsx": "4.20.6",
116
99
  "typescript": "^5.9.3",
117
- "typescript-eslint": "^8.46.2"
100
+ "typescript-eslint": "^8.46.2",
101
+ "vite": "7.1.11"
118
102
  },
119
103
  "publishConfig": {
120
104
  "access": "public"