Skip to content

Commit

Permalink
Deps: use lib-font as an npm dependency
Browse files Browse the repository at this point in the history
This changed required applying a change in the webpack config suggested by
lib-font's developer, detailed [here](https://github.com/Pomax/lib-font/#how-do-i-use-this-with-webpack).

Closes #53653
  • Loading branch information
Vicente Canales committed Sep 13, 2023
1 parent 8736452 commit f9f2f0d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/edit-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"downloadjs": "^1.4.7",
"fast-deep-equal": "^3.1.3",
"is-plain-object": "^5.0.0",
"lib-font": "2.4.0",
"memize": "^2.1.0",
"react-autosize-textarea": "^7.1.0",
"rememo": "^4.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ import { useContext } from '@wordpress/element';
*/
import { ALLOWED_FILE_EXTENSIONS } from './utils/constants';
import { FontLibraryContext } from './context';
import { Font } from '../../../../lib/lib-font.browser';
import makeFamiliesFromFaces from './utils/make-families-from-faces';
import { loadFontFaceInBrowser } from './utils';
/**
* External dependencies
*/
import { Font } from 'lib-font';

function LocalFonts() {
const { installFonts } = useContext( FontLibraryContext );
Expand Down
6 changes: 6 additions & 0 deletions tools/webpack/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,10 @@ module.exports = {
endYear: 2040,
} ),
].filter( Boolean ),
resolve: {
fallback: {
fs: false,
zlib: false,
},
},
};

0 comments on commit f9f2f0d

Please sign in to comment.