When we use sass or scss stylesheet engine, and we generate component rails g component button, the import './button.css' is always asking css file then than in folder we have scss or sass file.
We have to change that line in both templates/js.erb and templates/stimulus_controller_js.erb.
We have to update features in features/component_generator/stylesheet_engine.feature for all scenarios:
Then the file named "awesome_button/awesome_button.js" should contain:
"""
import "./awesome_button.[stylesheet_engine]";
"""
And update features/component_generator/stimulus.feature with a check to scss at least:
Then the file named "awesome_button/awesome_button.js" should contain:
"""
import "./awesome_button.scss";
"""
Then the file named "awesome_button/awesome_button_controller.js" should contain:
"""
import "./awesome_button.scss";
"""
When we use
sass
orscss
stylesheet engine, and we generate componentrails g component button
, theimport './button.css'
is always askingcss
file then than in folder we havescss
orsass
file.We have to change that line in both
templates/js.erb
andtemplates/stimulus_controller_js.erb
.to:
We have to update
features
infeatures/component_generator/stylesheet_engine.feature
for all scenarios:And update
features/component_generator/stimulus.feature
with a check toscss
at least: