vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
MIT License
9.7k stars 4.38k forks source link

Conflict with alias @ #1239

Open stephanedemotte opened 6 years ago

stephanedemotte commented 6 years ago

Conflict with alias @ with some packages like the new font awesome 5

vue-fontawesome bug report

LinusBorg commented 6 years ago

Hm, I could swear that this has been iced before.

Maybe some merge or rebase screwed it up again.

Will fix it.

LinusBorg commented 6 years ago

If you need to fix it yourself quickly, just change the alias from '@' to '@/'

LinusBorg commented 6 years ago

Hm that doesn't work - why? I swear that worked before. Jesus ...

Will look at this again tommorrow.

LinusBorg commented 6 years ago

It seems we may have to switch to some other alias. I've seen ~being used in nuxt, but that also has a special meaning in e.g. sass-loader: @import(~bootrap.scss)

We could simply use @@ .... looks funny but not that much worse than a single @

LinusBorg commented 6 years ago

Re-classifying as an enhancement, more fitting imho.

maxmilton commented 6 years ago

+1 for changing the alias.

@ conflicts with NPM orgs/teams and can be confusing when using both the @/ alias and NPM orgs/teams.

~ is confusing since it means the users home directory on unix machines.

What does that leave us with that's easy to type on all major international keyboards? There's also the question of whether to include the /.

LinusBorg commented 6 years ago

Thanks for the feedback, that's a great list of possible replacements.

Personally like $ or #, but I'm afraid t least $ could be problematic because it's used as a special chat in aliases, defining the end of the require string.

I'll play a bit wirh both to check for limitations, and ask everyone who's interested to do the same.

stephanedemotte commented 6 years ago

+1 for #

LinusBorg commented 6 years ago

I think we will indeed go with # - I've tested it a bit and it seems to work fine in all scenarios.

PierBover commented 6 years ago

Why not simply go with src?

LinusBorg commented 6 years ago

Because there might be packages whose name starts with src.

maxmilton commented 6 years ago

# or ## would be pretty great now that I think about it. I can't think of any conflicts other than looking similar to an internal target location in a href link, but that shouldn't be an issue with webpack imports (right?).

# is short and sweet, ## feels a lot more explicit and may be a good option for better clarity. I'm happy with either being the default.