slint/examples/rustwasmtest/webpack.config.js
Simon Hausmann e313f39490 Add simple rust wasm test
Needs an initial "npm install" and then "npm start" will build and launch it in the browser.
2020-05-13 11:24:51 +02:00

28 lines
534 B
JavaScript

const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
const dist = path.resolve(__dirname, "dist");
module.exports = {
mode: "production",
entry: {
index: "./js/index.js"
},
output: {
path: dist,
filename: "[name].js"
},
devServer: {
contentBase: dist,
},
plugins: [
new CopyPlugin([
path.resolve(__dirname, "static")
]),
new WasmPackPlugin({
crateDirectory: __dirname,
}),
]
};