anyone needs insert_into_file(between: ___) ? #824
xiaohui-zhangxh
started this conversation in
Ideas
Replies: 1 comment
-
My tricky solution is: inject_into_file 'config/webpacker.yml', after: /^development:\n *<<: \*default\n/ do
<<~YAML.indent(2)
extract_css: true # this is for dev
YAML
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm curious why nobody asking insert_into_file with between feature? I was get embarrassed many times without any solution to do this:
Here is a simplified webpacker.yml that we just focus on the key point.
I'm going to write a rails template that add
extract_css: true
todevelopment
section with this code:unfortunately
extract_css: true
already exists after production section which also after development section, so inject_into_file will do nothing.what if
inject_into_file
support optionbetween
or bi-optionsafter
+before
, it should inserted successfully.or
Beta Was this translation helpful? Give feedback.
All reactions