-
Hello, I started to use php and Symfony back in January and still have a lot to figure out. I organize my folder like this :
I configured webpack and got everything to work just fine but I was wondering (and maybe i did something wrong here) if it was possible to automatically gather all .js files and all .scss files from the different templates. As it is now, I have to manually require or import my files in my “assets/app.js” and “assets/app.scss”. @import '~/assets/styles/abstracts/mixins.scss';
@import '~/assets/styles/abstracts/variables.scss';
@import '~/assets/styles/base/base.scss';
@import '~/assets/styles/base/fonts.scss';
@import '~/templates/components/header/header.scss'; Am I doing something I shouldn’t do or is it the way it is supposed to work? Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Sass does not have a feature to import by globs. Regarding webpack, maybe there are loaders to do that. But you have more chances to get an answer by asking for support in the webpack community. |
Beta Was this translation helpful? Give feedback.
-
Hey, @Anoerak what you're doing it's totally legit! Even though, most people using sass use special Architecture to organize their imports. There are a lot of famous sass architecture formats, but the most famous one is the 7-1 https://sass-guidelin.es/#architecture. The idea is to have 7 folders, to put all your scss files and one (usually main.scss) in charge of importing everything. |
Beta Was this translation helpful? Give feedback.
Sass does not have a feature to import by globs.
Regarding webpack, maybe there are loaders to do that. But you have more chances to get an answer by asking for support in the webpack community.