4

I'm currently building an application using new rails 7 and js_bundling gem with webpack (not webpacker). But I'm having trouble making the javascript work.

I am currently packing all my sources into assets/builds/application.js with webpack which is working properly, and then including them in assets/config/manifest.js the following way:

//= link_tree ../images
//= link_tree ../builds

And finally i use javascript_include_tag "application", 'data-turbolinks-track': 'reload' in my views/layouts/application.html.erb to include it. I don't see where the includes are really coming from and no includes that I tried actually worked.

Thanks in advance for any suggestions on what to change. I'm fairly new to this concept of bundling so an explanation of how rails uses these includes would be welcome as well.

1
  • Can you see that your assets were created when you run webpack config? Commented Aug 4, 2022 at 13:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.