diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 14c9124..3788216 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -12,7 +12,8 @@ "presetter": "^4.0.1", "vite": "^4.4.2", "vite-plugin-node-polyfills": "^0.9.0", - "vite-plugin-optimizer": "^1.4.2" + "vite-plugin-optimizer": "^1.4.2", + "vite-plugin-wasm": "^3.2.2" } }, "node_modules/@ampproject/remapping": { @@ -18130,6 +18131,14 @@ "resolved": "https://registry.npmjs.org/vite-plugin-optimizer/-/vite-plugin-optimizer-1.4.2.tgz", "integrity": "sha512-UNQy+J31b+DeEc2NCxV+WIkwyYPWGPjYsnXO4+gM26CKY5KJ47JeRjchR11F3qfR8MWDX1+425LZfkUyXOfGFA==" }, + "node_modules/vite-plugin-wasm": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/vite-plugin-wasm/-/vite-plugin-wasm-3.2.2.tgz", + "integrity": "sha512-cdbBUNR850AEoMd5nvLmnyeq63CSfoP1ctD/L2vLk/5+wsgAPlAVAzUK5nGKWO/jtehNlrSSHLteN+gFQw7VOA==", + "peerDependencies": { + "vite": "^2 || ^3 || ^4" + } + }, "node_modules/vite/node_modules/@esbuild/android-arm": { "version": "0.18.11", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.11.tgz", diff --git a/package.json b/package.json index c0cb81d..1e22ac3 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "presetter": "^4.0.1", "vite": "^4.4.2", "vite-plugin-node-polyfills": "^0.9.0", - "vite-plugin-optimizer": "^1.4.2" + "vite-plugin-optimizer": "^1.4.2", + "vite-plugin-wasm": "^3.2.2" }, "publishConfig": { "access": "public" diff --git a/templates/vite.config.js b/templates/vite.config.js index fecbc96..39892ef 100644 --- a/templates/vite.config.js +++ b/templates/vite.config.js @@ -1,10 +1,12 @@ import { defineConfig } from "vite"; import optimizer from "vite-plugin-optimizer"; import { nodePolyfills } from "vite-plugin-node-polyfills"; +import wasm from "vite-plugin-wasm"; export default defineConfig({ build: {viteBuild}, resolve: {viteResolve}, plugins: [ + wasm(), optimizer({viteOptimize}), nodePolyfills({vitePolyfill}), ],