Open 0xinhua opened 3 years ago
Hi, How to import stylus file and use alias with nuxt-vite, I upgrade nuxt with nuxt-vite and have read and check other issues but it doesn't works ~
nuxt-vite: ^0.0.37 nuxt: ^2.15.6
vue template file:
<style lang="stylus" scoped> @import "@/style/base/base.styl" </style>
nuxt.config.js file:
{ buildModules: ['nuxt-vite', '@nuxtjs/style-resources'], vite: { resolve: { alias: { '@': require('path').resolve(__dirname, 'src'), }, }, }, }
build error:
failed to locate @import file @/style/base/base.styl 74| } 75| </script> 76| 77| <style lang="stylus" scoped> 78| @import '@/style/base/base.styl' ---------------^
thanks ~
I had the same problem~
62| <style lang="stylus" rel="stylesheet/stylus"> 63| @import "~@/common/stylus/variable.styl" ---------------^ failed to locate @import file ~@/common/stylus/variable.styl
62| <style lang="stylus" rel="stylesheet/stylus">
63| @import "~@/common/stylus/variable.styl"
---------------^
failed to locate @import file ~@/common/stylus/variable.styl
Hi, How to import stylus file and use alias with nuxt-vite, I upgrade nuxt with nuxt-vite and have read and check other issues but it doesn't works ~
Versions
nuxt-vite: ^0.0.37 nuxt: ^2.15.6
Reproduction
vue template file:
nuxt.config.js file:
build error:
thanks ~