Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are there two assets at the same time? Why are the ~assets and ~/assets #1241

Closed
yuchonghua opened this issue Aug 1, 2017 · 21 comments
Closed

Comments

@yuchonghua
Copy link

yuchonghua commented Aug 1, 2017

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)
@alexchopin
Copy link
Member

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.

@yuchonghua
Copy link
Author

yuchonghua commented Aug 1, 2017

~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

@js-yezi
Copy link

js-yezi commented Aug 1, 2017

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

@HadiChen
Copy link

HadiChen commented Aug 1, 2017

@alexchopin Would you please fix this situation?

@yuchonghua
Copy link
Author

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

@yuchonghua
Copy link
Author

yuchonghua commented Aug 10, 2017

  • Now vue file introduction style or problems

image
image


\ping @alexchopin @pi0 @Atinux

@pi0
Copy link
Member

pi0 commented Aug 10, 2017

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

@yuchonghua
Copy link
Author

image
image

@yuchonghua
Copy link
Author

yuchonghua commented Aug 10, 2017

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

image

image

@HadiChen
Copy link

I am also experiencing this problem

1 similar comment
@coderPreacher
Copy link

I am also experiencing this problem

@pi0 pi0 reopened this Aug 10, 2017
@js-yezi
Copy link

js-yezi commented Aug 11, 2017

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

@yuchonghua
Copy link
Author

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

image

image

image

@zhong-jia-wei
Copy link

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

@Depravitys
Copy link

I have the same problem,Can some one tell me how to do this?

@pi0
Copy link
Member

pi0 commented Aug 12, 2017

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

pi0 pushed a commit that referenced this issue Aug 12, 2017
@pi0
Copy link
Member

pi0 commented Aug 12, 2017

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

@yuchonghua
Copy link
Author

thank @pi0 very much

@pi0
Copy link
Member

pi0 commented Aug 13, 2017

Will be available in rc5.

@yuchonghua
Copy link
Author

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

@lock
Copy link

lock bot commented Nov 4, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 4, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants