Skip to content

webpack path aliases for <style></style> in Component.vue files #1113

Closed
@yyx990803

Description

@yyx990803

Moved from vuejs/vue#7400

What problem does this feature solve?

Basically today I noticed that webpack aliases work properly for import statements, however not with <style> </style> section of .vue component. Example given: '@': './src' alias works fine with import smth from '@/smth' in <script> </script> section, but when i tried this: <style> .jumbotron { background: url('@/assets/images/welcome.jpg') center / cover; } </style> it failed, I thought it would be great to be able to write code this way, so Component.vue works even if its location changes. That would be super cool. Btw I love Vue, thanks a lot for a great work!

**webpack aliases for .vue <style></style> section

What does the proposed API look like?

<style> .jumbotron { background: url('@/assets/images/welcome.jpg') center / cover; } </style>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions