slint/examples/slide_puzzle/wasm/webpack.config.js
Simon Hausmann 2472eb51f0 Add the plaster font to plaster theme of the slide puzzle
For regular builds this is done by adding Rust API that allows
registering a font, and for the web the font is installed into the
browser using JavaScript API.

This is an initial approach to just add this ability. It might make
sense to introduce a syntax in the `.60` file to allow for the
registration of fonts and letting the compiler generate code that
performs this embedding and registration automatically.
2020-11-27 14:29:56 +01:00

31 lines
762 B
JavaScript

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