Vue-cli: build script not copying all image assets to dist/img

Created on 16 Aug 2018  路  2Comments  路  Source: vuejs/vue-cli

Version

3.0.0

Node and OS info

OS: Windows 10 Enterprise, node v8.11.2, npm 5.6.0

Steps to reproduce

  1. execute vue create vue_cli_issue (choose default template)
  2. add my-image.png to /src/assets
  3. in Home.vue, duplicate img tag and change src attribute to "@/assets/my-image.png"
  4. execute npm run build

What is expected?

logo.png and my-image.png get renamed with cache-bust hashes and copied to /dist/img

What is actually happening?

only logo.png gets a hash and copied to /dist

if I npm run serve, my additional img tag isn't even being compiled into the template. only img for logo.png is rendered into the dom


sample repo

Most helpful comment

The file is too small (<4kb) so it is inlined as base64 string in your javascript.

All 2 comments

The file is too small (<4kb) so it is inlined as base64 string in your javascript.

That's it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DrSensor picture DrSensor  路  3Comments

BusyHe picture BusyHe  路  3Comments

b-zee picture b-zee  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments

PrimozRome picture PrimozRome  路  3Comments