-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
29 lines (28 loc) · 938 Bytes
/
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
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
const webpack = require("webpack");
const path = require("path");
module.exports = {
chainWebpack: config => {
config
.plugin("wasm-pack")
.use(WasmPackPlugin)
.init(
Plugin =>
new Plugin({
crateDirectory: path.resolve(__dirname, "./wasm")
})
)
.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();
}
};