Nuxt.js: Why are there two assets at the same time? Why are the ~assets and ~/assets

Created on 1 Aug 2017  路  21Comments  路  Source: nuxt/nuxt.js

Why are there two assets at the same time?
Why are the ~assets and ~/assets
image
@pi0 @alexchopin

This question is available on Nuxt.js community (#c1098)
available soon question

Most helpful comment

I am also experiencing this problem

All 21 comments

Hi @yuchonghua,
~assets is a Vue.js (vue-router) alias and can be used inside <template> and <style> tags.
~/assets is a Nuxt.js alias and can be used inside <script> tag.

~assets and ~/assets can be unified

If not uniform, feel the new version of nuxt use is very strange, even the name of each place is not the same
image

@alexchopin

@alexchopin
Yes ah, I have encountered this problem, why engage in two standards?
Is not it awkward to develop?

@alexchopin Would you please fix this situation?

@Atinux Do not you think it's not a troublesome thing? Even with a path to use a different logo to visit? The

  • Now vue file introduction style or problems

image
image


\ping @alexchopin @pi0 @Atinux

Just as a test, does change it to @/assets/web/... fixes problem?

image
image

Use ~assets/web/images/... can be normal

image

image

I am also experiencing this problem

I am also experiencing this problem

Now vue-loader loading style inside the css have this problem, what is the reason for this problem?


git clone https://github.com/ddvjs/nuxt-assets-bug.git
cd nuxt-assets-bug
npm i
npm run dev

image

image

image

I also encountered this problem. But have not found a solution

I have the same problem锛孋an some one tell me how to do this?

After some investigations, it seems this problem is not causing by vue-loader/transofrm-require that was fixed for templates usage. Currently before finding fix, as @yuchonghua suggested the only workaround is using ~assets/web/images/...
PS: Related issue: webpack-contrib/css-loader#256

2ff8b5a should finally allow ~/assets and ~/static usage everywhere ^_^ Keeping this thread open until next release if anyone has better workaround :)

thank @pi0 very much

Will be available in rc5.

Very much hope that rc5 can be released faster.
/ping @Atinux @pi0

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mattdharmon picture mattdharmon  路  3Comments

vadimsg picture vadimsg  路  3Comments

bimohxh picture bimohxh  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

shyamchandranmec picture shyamchandranmec  路  3Comments