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

412
Views
¿Cómo cambiar el nombre de archivo dentro de una regla? (Vue CLI 5)

Tengo esta regla, usando vue inspect

 /* config.module.rule('svg') */ { test: /\.(svg)(\?.*)?$/, type: 'asset/resource', generator: { filename: 'img/[name][ext]' } },

Necesito cambiar el nombre del archivo, por ejemplo, a "[contenthash][ext]", pero no puedo hacerlo usando

 module.exports = defineConfig({ chainWebpack: (config) => { config.module.rule("svg").generator.filename = "[contenthash][ext]"; }, })

porque no puedo configurar el generador,

Puedo reescribir todas las reglas usando

 module.exports = defineConfig({ configureWebpack: (config) => { config.module.rules = [ { test: /\.(svg)(\?.*)?$/, use: [ { loader: "svg-inline-loader", options: { name: "[contenthash].[ext]", }, }, ], }, ]; }, })

pero necesito que existan otras reglas... entonces, ¿cómo puedo cambiar el nombre de archivo de svg?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Prueba esto:

 chainWebpack: (config) => { config.module.rule("svg") .set('generator', { filename: "[contenthash][ext]" }) }

Fuente

over 4 years ago · Santiago Trujillo 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!