-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: SASS implementation does not support different CSS builds per Engines #364
Comments
@malparty Did you check the syles in any engine on MIA? e.g. https://github.com/nimblehq/mia-web/blob/development/engines/mia_account/app/assets/stylesheets/mia_account/application.scss. It requires Webpack though as noted in this config: https://github.com/nimblehq/mia-web/blob/752f45a860b25bdc456c1bcc82b6b5a6ca18e334/config/webpacker.yml#L11-L23 |
Yes it is using Webpack and from my understanding, the Nimble Rails Template is trying to move away from Webpack, no? 🤔 |
Rails is not including Webpack by default to have a leaner base fraemwork and also leaving the door open to other build tools like Esbuild. IMO for building a medium to complex application, having a build tool might be needed. Think of usin PostCSS for adding browsers prefixes, using new CSS features, etc. Nowadays I would recommend to use Esbuild when a build tool is required. |
Might I know what is the current CSS precompile lib in the current template @malparty 🤔 |
DartSass allow us to separate the build
We are using it in Phoenix project, this is the configuration from the Elixir side (it will convert to DartSass command) |
@andyduong1920 @olivierobert after some review/challenges, we rolled back to use When implementing this task, I will add the needed documentation to have stylesheets ready for engines. Mainly 2 things:
|
Issue
The current way SCSS files are pre-compiled in our template only works with the root stylesheets. There is no documentation or example on extending that to have different stylesheet builds for the engines.
Moreover, I am not sure that this script supports importing a
core
SCSS file from the root app into the SCSS files built within the engine — e.g. when we want to share bootstrap variables.Expected
The Template provides a ready-to-use CSS pre-compilation that extends seamlessly when creating a new engine
Technical Options
sass
script inpackage.json
, but add a syntax that would also build the paths within the engines 🤔sassc-rails
gem instead ofcssbundling-rails
, rename theapplication
stylesheets pack intoapplication_style
(to prevent conflict with the JS one) and let Rails handle the engine mapping (tested and working well with core SCSS!)The text was updated successfully, but these errors were encountered: