Is there a way to dynamically import a file using environment variables?
I want to include a specific client's general theme SCSS to my app.vue (or main.ts)
I'm thinking of something along the lines of:
<style lang="sass">
@import"./themes/" + process.env.VUE_APP_CLIENT + "/assets/scss/theme.scss";
</style>
or
import "./themes/" + process.env.VUE_APP_CLIENT + "/assets/scss/theme.scss";
How can I make this work?
If I try using import
(in the main.ts), it gives me an error saying
Object is possibly 'undefined'.
If I try using <style>
and @import
(inside app.vue)
undefined ^ Media query expression must begin with '('
Any suggestions on how to achieve this?