why do we have fonts if we don't use them?
This commit is contained in:
@@ -5,7 +5,6 @@ import { buildScss } from './tasks/scss.js';
|
||||
import { buildImg } from './tasks/img.js';
|
||||
import { buildTemplates } from './tasks/templates.js';
|
||||
import { Logger } from './utils/logger.js';
|
||||
import { buildFonts } from './tasks/fonts.js';
|
||||
import { optimizeCss } from './tasks/optimize-css.js';
|
||||
const srcPath = join(cwd(), 'src');
|
||||
const distPath = join(cwd(), 'dist');
|
||||
@@ -16,7 +15,7 @@ function exit(err) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
} else {
|
||||
console.log('')
|
||||
console.log('');
|
||||
logger.info('Build completed successfully');
|
||||
}
|
||||
|
||||
@@ -36,7 +35,6 @@ async function build() {
|
||||
await Promise.all([
|
||||
buildScss(srcPath, distPath).then(() => optimizeCss(distPath)),
|
||||
buildImg(srcPath, distPath),
|
||||
buildFonts(srcPath, distPath),
|
||||
buildTemplates(srcPath, distPath),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import { copyFileSync, mkdirSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
import { readFiles } from '../utils/funcs.js';
|
||||
import { Logger } from '../utils/logger.js';
|
||||
|
||||
const logger = new Logger(buildFonts.name, 'info', 'brightCyan');
|
||||
const imgSrc = 'themes/fonts';
|
||||
const imgDest = '/public/assets/fonts';
|
||||
|
||||
export async function buildFonts(srcHome, distHome) {
|
||||
logger.info('Fonts build has started');
|
||||
const fontsSrcPath = join(srcHome, imgSrc);
|
||||
const fontsDestPath = join(distHome, imgDest);
|
||||
|
||||
mkdirSync(fontsDestPath, { recursive: true });
|
||||
|
||||
const files = readFiles(fontsSrcPath, [
|
||||
'.woff',
|
||||
'.woff2',
|
||||
'.ttf',
|
||||
'.eot',
|
||||
'.svg',
|
||||
'.otf',
|
||||
]);
|
||||
|
||||
for (const file of files) {
|
||||
// just copy the file
|
||||
copyFileSync(join(fontsSrcPath, file), join(fontsDestPath, file));
|
||||
}
|
||||
|
||||
logger.info('Fonts build has finished');
|
||||
}
|
||||
Reference in New Issue
Block a user