wasm-image-optimization 1.4.0 → 1.4.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.
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"]}