Skip to content

Commit

Permalink
Copy fonts only on a build
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Dec 5, 2024
1 parent 433e03b commit ce85894
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/dnb-design-system-portal/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,6 @@ exports.createPages = async (params) => {
await createRedirects(params)
}

exports.onPreBootstrap = async (params) => {
// Copy the fonts folder
const { program } = params.store.getState()
const publicDir = path.join(program.directory, 'public', 'fonts')
const rootPath = path.dirname(require.resolve('@dnb/eufemia'))
const src = path.resolve(rootPath, 'assets', 'fonts')
await copyDirectory(src, publicDir)
}

exports.onPostBuild = async (params) => {
await createRedirects(params)

Expand All @@ -138,6 +129,13 @@ exports.onPostBuild = async (params) => {
.join('\n')}\n\n`,
)
}

// Copy the fonts folder
const { program } = params.store.getState()
const publicDir = path.join(program.directory, 'public', 'fonts')
const rootPath = path.dirname(require.resolve('@dnb/eufemia'))
const src = path.resolve(rootPath, 'assets', 'fonts')
await copyDirectory(src, publicDir)
}

const deletedPages = []
Expand Down

0 comments on commit ce85894

Please sign in to comment.