Closed Spone closed 6 years ago
I should be able to run the rails generate component button command several times with the same result. Currently, it duplicates the import in frontend/components/index.js
rails generate component button
frontend/components/index.js
I think we just need to deduplicate the imports when we sort them here: https://github.com/komposable/komponent/blob/master/lib/generators/component/component_generator.rb#L173
Yes, remove duplicates before rewriting it to file seems the only thing to do to make this possible.
I should be able to run the
rails generate component button
command several times with the same result. Currently, it duplicates the import infrontend/components/index.js
I think we just need to deduplicate the imports when we sort them here: https://github.com/komposable/komponent/blob/master/lib/generators/component/component_generator.rb#L173