mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
* Configure rust-analyzer to target wasm32-unknown-unknown * Watch changes to core rust files
25 lines
711 B
JavaScript
25 lines
711 B
JavaScript
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
|
|
const path = require("path");
|
|
|
|
module.exports = {
|
|
lintOnSave: "warning",
|
|
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"),
|
|
watchDirectories: [path.resolve(__dirname, "../../core")],
|
|
})
|
|
)
|
|
.end();
|
|
|
|
const svgRule = config.module.rule("svg");
|
|
svgRule.uses.clear();
|
|
svgRule.use("vue-loader").loader("vue-loader").end().use("vue-svg-loader").loader("vue-svg-loader");
|
|
},
|
|
};
|