You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
Vue samples seem to use 'import "@/components/..."' paths, which is automatically set up for Vue CLI projects.
This notion does not work for rollup-plugin-vue users, adding to the threshold or frustration of using Rollup instead of the default build pipeline.
I do not know, whether handling alias paths within rollup-plugin-vue makes sense. The work-around is to use '@rollup/plugin-alias' and set up such an alias on your own.
One solution could be not to do technically anything within rollup-plugin-vue but to instruct people how such an alias is to be done.
// rollup.config.js
import alias from '@rollup/plugin-alias';
...
// For '@/...' to work like it does for Vue CLI -configured projects.
alias({
entries: {
['@']: path.resolve(__dirname, 'src')
}
What does the proposed API look like?
No API. Importing from @/ would map to the src folder.
The text was updated successfully, but these errors were encountered:
Hitting this issue too. I am making a library which includes vue components, and use import aliases.
Once compiled the alias paths are still there instead of being replaced, so when using my library, the code inside it tries to import with the original alias path
importpathfrom"path";
...
importaliasfrom"@rollup/plugin-alias";
...
// For '@/...' to work like it does for Vue CLI -configured projects.alias({entries: {['@']: path.resolve(__dirname,'src')})
...
What problem does this feature solve?
Vue samples seem to use 'import "@/components/..."' paths, which is automatically set up for Vue CLI projects.
This notion does not work for rollup-plugin-vue users, adding to the threshold or frustration of using Rollup instead of the default build pipeline.
I do not know, whether handling alias paths within rollup-plugin-vue makes sense. The work-around is to use '@rollup/plugin-alias' and set up such an alias on your own.
One solution could be not to do technically anything within
rollup-plugin-vue
but to instruct people how such an alias is to be done.What does the proposed API look like?
No API. Importing from
@/
would map to thesrc
folder.The text was updated successfully, but these errors were encountered: