diff --git a/webpack.config.js b/webpack.config.js index d8d6bef..c10252c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -64,12 +64,20 @@ class GitHashJsonPlugin { const CopyAssetsPlugin = { apply: (compiler) => { compiler.hooks.afterEmit.tap('CopyAssetsPlugin', () => { - // Copy assets directory + // Copy assets directory but exclude fonts (webpack handles fonts with hashed names) const assetsSrc = path.resolve(__dirname, 'public/assets'); const assetsDest = path.resolve(__dirname, 'dist/assets'); try { - cpSync(assetsSrc, assetsDest, { recursive: true }); - console.log('Assets copied successfully'); + // Copy all assets except fonts + const items = fs.readdirSync(assetsSrc); + for (const item of items) { + if (item !== 'fonts') { + const srcPath = path.join(assetsSrc, item); + const destPath = path.join(assetsDest, item); + cpSync(srcPath, destPath, { recursive: true }); + } + } + console.log('Assets copied successfully (fonts excluded - handled by webpack)'); } catch (err) { console.error('Error copying assets:', err); }