♻️(frontend) Marianne single source of truth
We now use Marianne font from @gouvfr-lasuite/ui-kit package instead of a versionned local copies. This ensures we always use the latest version of the font. During a build or dev command, Marianne font files are copied from node_modules to the public assets folder. They can stop being versionned.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
const crypto = require('crypto');
|
||||
const path = require('path');
|
||||
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
const { InjectManifest } = require('workbox-webpack-plugin');
|
||||
|
||||
const buildId = crypto.randomBytes(256).toString('hex').slice(0, 8);
|
||||
@@ -41,6 +43,21 @@ const nextConfig = {
|
||||
},
|
||||
);
|
||||
|
||||
// Copy necessary fonts from node_modules to public directory during build or dev
|
||||
config.plugins.push(
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: path.resolve(
|
||||
__dirname,
|
||||
'../../node_modules/@gouvfr-lasuite/ui-kit/dist/assets/fonts/Marianne',
|
||||
),
|
||||
to: path.resolve(__dirname, 'public/assets/fonts/Marianne'),
|
||||
},
|
||||
],
|
||||
}),
|
||||
);
|
||||
|
||||
if (!isServer && process.env.NEXT_PUBLIC_SW_DEACTIVATED !== 'true') {
|
||||
config.plugins.push(
|
||||
new InjectManifest({
|
||||
|
||||
Reference in New Issue
Block a user