-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
37 lines (36 loc) · 1.22 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const path = require("path");
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
const webpack = require("webpack");
module.exports = {
"transpileDependencies": [
"vuetify"
],
publicPath: process.env.NODE_ENV === 'production'
? '/helixiser/'
: '/',
// everything below is for WASM (web assembly from Rust)
chainWebpack: (config) => {
// rust wasm bindgen https://github.com/rustwasm/wasm-bindgen
config
.plugin("wasm-pack")
.use(WasmPackPlugin)
.init(
(Plugin) =>
new Plugin({
crateDirectory: path.resolve(__dirname, "./wasm/helixiser-interface"),
})
)
.end()
// needed for Edge browser https://rustwasm.github.io/docs/wasm-bindgen/examples/hello-world.html
.plugin("text-encoder")
.use(webpack.ProvidePlugin)
.init(
(Plugin) =>
new Plugin({
TextDecoder: ["text-encoding", "TextDecoder"],
TextEncoder: ["text-encoding", "TextEncoder"],
})
)
.end();
},
};