feat: introduce font picker (#8012)

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
Marcel Mraz 2024-07-25 18:55:55 +02:00 committed by GitHub
parent 4c5408263c
commit 62228e0bbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
120 changed files with 3390 additions and 1106 deletions

View file

@ -1,6 +1,8 @@
const { build } = require("esbuild");
const { sassPlugin } = require("esbuild-sass-plugin");
const { externalGlobalPlugin } = require("esbuild-plugin-external-global");
const { woff2BrowserPlugin } = require("./woff2/woff2-esbuild-plugins");
// Will be used later for treeshaking
//const fs = require("fs");
// const path = require("path");
@ -43,16 +45,13 @@ const browserConfig = {
format: "esm",
plugins: [
sassPlugin(),
woff2BrowserPlugin(),
externalGlobalPlugin({
react: "React",
"react-dom": "ReactDOM",
}),
],
splitting: true,
loader: {
".woff2": "copy",
".ttf": "copy",
},
};
const createESMBrowserBuild = async () => {
// Development unminified build with source maps
@ -61,6 +60,7 @@ const createESMBrowserBuild = async () => {
outdir: "dist/browser/dev",
sourcemap: true,
chunkNames: "excalidraw-assets-dev/[name]-[hash]",
assetNames: "excalidraw-assets-dev/[name]-[hash]",
define: {
"import.meta.env": JSON.stringify({ DEV: true }),
},
@ -72,6 +72,7 @@ const createESMBrowserBuild = async () => {
outdir: "dist/browser/prod",
minify: true,
chunkNames: "excalidraw-assets/[name]-[hash]",
assetNames: "excalidraw-assets/[name]-[hash]",
define: {
"import.meta.env": JSON.stringify({ PROD: true }),
},
@ -99,11 +100,8 @@ const rawConfig = {
entryPoints: ["index.tsx"],
bundle: true,
format: "esm",
plugins: [sassPlugin()],
plugins: [sassPlugin(), woff2BrowserPlugin()],
loader: {
".woff2": "copy",
".ttf": "copy",
".json": "copy",
},
packages: "external",