Last active
February 26, 2021 06:08
-
-
Save noelrappin/524e14b58effeef47731d881a6925114 to your computer and use it in GitHub Desktop.
Perhaps for beginners - How to find / install / use a common JS frontend library from Yarn
When writting a simple app with no complex frontend, just some jquery and some plugins for it, I find it hard to figure out how to make things work. Making it so that a <script type="javascript">
in a view (so not in the webpack context) can work and use jquery and the plugins is not obvious at all.
In my mind, this is the simple, basic, initial use case of rails. But with Rails 6 (webpacker), it is no longer trivial to do. I think the guide should explain how to do that too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you need any help, I also have some spare time to help collaborating on this guide. Like you said on https://discuss.rubyonrails.org, maybe it's best if you'd make a repository out of this guideline and if you want we can collaborate there.
I started to write my ideas down here:
https://github.com/codergeek121/rails/blob/webpacker-guides/guides/source/webpacker_overview.md
I think @noelrappin means requiring and importing other files with webpack here?
I think so too, maybe one or two sentences on the decision on why Sprockets and Webpacker helps a lot against some confusion about the topic.