If you have a file inside /packs called application.js that has a line
"import Something from '../some_js'", webpacker will include the code from
"some_js.js" inside the resulting bundle "application.js".

El lun., 23 dic. 2019 a las 12:10, fugee ohu (<fugee...@gmail.com>)
escribió:

>
>
> On Sunday, December 22, 2019 at 6:10:58 PM UTC-5, Ariel Juodziukynas wrote:
>>
>> There's a section specifying where to put js files on the documentation
>> https://github.com/rails/webpacker#paths. You can put the files
>> anywhere, if you put them inside the packs folder webpacker will create
>> bundles using those files, if you put them elsewhere wenpacker will bundle
>> them inside the packs that require them.
>>
>> El dom., 22 dic. 2019 a las 4:48, fugee ohu (<fuge...@gmail.com>)
>> escribió:
>>
>>> Where do I put my custom javascript files now, under javascripts or
>>> under javascripts/packs or should i create a directory like 'custom' under
>>> javascripts and then in javascript/packs/application.js i would have to
>>> import "../custom" and that would import all the javascript files in the
>>> custom directory Can someone please clarify?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to rubyonra...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/8295b70b-e09e-4fe3-96ba-cb5017125ace%40googlegroups.com
>>> <https://groups.google.com/d/msgid/rubyonrails-talk/8295b70b-e09e-4fe3-96ba-cb5017125ace%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
> wenpacker will bundle them inside the packs that require them
> What does that mean?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/b479f7ff-e3ce-4337-bd94-12042605bc84%40googlegroups.com
> <https://groups.google.com/d/msgid/rubyonrails-talk/b479f7ff-e3ce-4337-bd94-12042605bc84%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPS3bcC-E2JXvA4t51Mhe%3Dgu-wq%2Bqdo1eWxvwh7f02segOWtig%40mail.gmail.com.

Reply via email to