mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 22:54:36 +00:00

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.
31 lines
762 B
JavaScript
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,
|
|
}),
|
|
]
|
|
};
|