diff --git a/package-lock.json b/package-lock.json index c2843123b40dcc..69c0f95b096206 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37128,6 +37128,11 @@ "node": ">= 0.8.0" } }, + "node_modules/lib-font": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/lib-font/-/lib-font-2.4.0.tgz", + "integrity": "sha512-j2Hyn12JjMLe9JkFDRq40q4+tOeDg276Z9Ezxyhas8HEv0jNLbRXyzG7r7n6QdLbWRtL2RYQtgVlIt3Q4ur6nQ==" + }, "node_modules/lib0": { "version": "0.2.79", "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.79.tgz", @@ -55401,6 +55406,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", @@ -68175,6 +68181,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", @@ -86994,6 +87001,11 @@ "type-check": "~0.3.2" } }, + "lib-font": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/lib-font/-/lib-font-2.4.0.tgz", + "integrity": "sha512-j2Hyn12JjMLe9JkFDRq40q4+tOeDg276Z9Ezxyhas8HEv0jNLbRXyzG7r7n6QdLbWRtL2RYQtgVlIt3Q4ur6nQ==" + }, "lib0": { "version": "0.2.79", "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.79.tgz", diff --git a/packages/edit-site/package.json b/packages/edit-site/package.json index a74742def329cf..927b4261ce6471 100644 --- a/packages/edit-site/package.json +++ b/packages/edit-site/package.json @@ -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", diff --git a/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js b/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js index 7d5f7a2f79b169..25d4a780f7be32 100644 --- a/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js +++ b/packages/edit-site/src/components/global-styles/font-library-modal/local-fonts.js @@ -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 ); diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index 3dc8407d7974b9..a62e9235b18fd8 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -167,4 +167,10 @@ module.exports = { endYear: 2040, } ), ].filter( Boolean ), + resolve: { + fallback: { + fs: false, + zlib: false, + }, + }, };