I am curious, what is the '@' for in 'npm install -g @vue/cli'
Why don't they just have it as 'vue/cli' instead of '@vue/cli'?
I am curious, what is the '@' for in 'npm install -g @vue/cli'
Why don't they just have it as 'vue/cli' instead of '@vue/cli'?
This is done to resolve the package better. For example, with Webpack resolve.alias
configuration option (isn't specific to Vue).
In Vue Webpack template, Webpack is configured to replace @/
with src
path:
const path = require('path');
...
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
...
'@': path.resolve('src'),
}
},
...
The alias could then be used as:
import '@/<path inside src folder>';