The problem of packing picture files in Nuxt.js assest directory

The picture file in the

assets directory is not packaged.
after npm run dev, the local localhost:3000 opens the image directly under the referenced assets directory.
as shown in figure

ask if there is something wrong with my configuration or something else.

May.26,2022

Please note: starting with Nuxt 2.0, ~ / alias will not parse correctly in the CSS file. You must use ~ assets (no slash) or @ alias, that is,

, in the url CSS reference.
background:url("~assets/banner.svg")

see if this is the problem

Menu