LoginSignup
7
5

More than 5 years have passed since last update.

Nuxt.jsで src="~assets/hoge.jpg" が変換されなくて困った

Posted at

変換される :thumbsup_tone5:

<img src="~assets/hoge.jpg" />

変換されない :thinking:

<v-card-media src="~assets/hoge.jpg" />

以下を追記して変換されるようにした

nuxt.config.js
build: {
  extend(config, { isDev, isClient }) {   
     const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')
     vueLoader.options.transformToRequire['v-card-media'] = ['src']
  }
}

他になんか方法ないの?

7
5
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5