Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
Base64 de la fuente en línea del paquete web

Necesito obtener la fuente que está en ./src/assets/fonts y convertirla a base64

mi config-overrides.js

 addWebpackModuleRule({ test: /\.ttf$/, use: [ { loader: 'ttf-loader', options: { name: './src/assets/fonts/[hash].[ext]' } } ] }),

y el propio archivo, en el que importo esta fuente, donde ya la convertí a base64

 import font from '../assets/fonts/font.ttf' const someFun = () =>{ return btoa(font); }

pero estoy recibiendo un error

 Module parse failed: Unexpected token (4:7) File was processed with these loaders: * ./node_modules/ttf-loader/src/index.js You may need an additional loader to handle the result of these loaders. | | module.exports = createFontFamily({ > ttf: export default __webpack_public_path__ + "./src/assets/fonts/7233a7aee250f9b77fba5f735143ad39.ttf", | woff: export default __webpack_public_path__ + "./src/assets/fonts/f46b66ed2d54e5321411edfe916b7300.woff", | });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Bien, cambié el cargador a este

 loader: 'base64-inline-loader'

y ahora todo funciona. Automáticamente convertirá el archivo a base64

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!