Commit 0f8047d9 authored by chechunchi's avatar chechunchi

setup vite-plugin-wasm-pack

parent 42483217
Pipeline #20674 failed with stages
in 2 minutes and 55 seconds
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
"react-redux": "^8.0.4", "react-redux": "^8.0.4",
"react-router-dom": "^6.4.0", "react-router-dom": "^6.4.0",
"react-scripts": "^2.1.3", "react-scripts": "^2.1.3",
"rust-src": "file:rust-src/pkg",
"socket.io-client": "^4.5.1", "socket.io-client": "^4.5.1",
"sql.js": "^1.8.0", "sql.js": "^1.8.0",
"vite-plugin-svgr": "^2.4.0", "vite-plugin-svgr": "^2.4.0",
...@@ -34,7 +33,7 @@ ...@@ -34,7 +33,7 @@
"ygopro-deck-encode": "^1.0.3" "ygopro-deck-encode": "^1.0.3"
}, },
"scripts": { "scripts": {
"wasm": "cd rust-src && wasm-pack build", "wasm": "wasm-pack build ./rust-src --target web",
"dev": "npm run wasm && vite", "dev": "npm run wasm && vite",
"build": "tsc && vite build && cp -r neos-assets dist/", "build": "tsc && vite build && cp -r neos-assets dist/",
"build:prod": "tsc && vite build --base=https://cdn02.moecube.com:444/neos/", "build:prod": "tsc && vite build --base=https://cdn02.moecube.com:444/neos/",
......
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr' import svgr from 'vite-plugin-svgr'
import wasmPack from 'vite-plugin-wasm-pack';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react(), svgr()] plugins: [react(), svgr(), wasmPack('./rust-src')]
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment