Files
matrix-rust-sdk/crates/matrix-sdk/examples/wasm_command_bot/webpack.config.js
Damir Jelić f2e2976496 fix(sdk): Make the wasm_command_bot example compile and work
This patch does a couple of things:

1. Fix the compilation of the example, Message -> MessageLike
2. Update Webpack and friends for the example
3. Remove futures-timer's Delay method and use equivalent methods from
   Tokio and wasm-timers.

The last point was needed because futures-timer would end up triggering
this error:
    ReferenceError: can't access lexical declaration '__wbg_clearTimeout_d8b36ad8fa330187' before initialization
2022-04-05 14:02:07 +02:00

26 lines
615 B
JavaScript

const path = require('path');
const HTMLWebpackPlugin = require('html-webpack-plugin');
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
module.exports = {
mode: 'development',
devtool: 'eval-source-map',
entry: './index.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
},
experiments: {
asyncWebAssembly: true
},
resolve: {
extensions: ['.js'],
},
plugins: [
new HTMLWebpackPlugin(),
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, ".")
}),
],
};