# Trouble Utilizing Webpacker for JS in Gem Development

**URL:** <https://discuss.rubyonrails.org/t/trouble-utilizing-webpacker-for-js-in-gem-development/77046>\
**Category:** Uncategorized\
**Created:** [January 26, 2021, 4:20pm UTC](https://discuss.rubyonrails.org/t/trouble-utilizing-webpacker-for-js-in-gem-development/77046 "2021-01-26T16:20:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Websitescenes](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/websitescenes/32/2918_2.png) [@Websitescenes](https://discuss.rubyonrails.org/u/Websitescenes)\
**Post date:** [January 26, 2021, 4:20pm UTC](https://discuss.rubyonrails.org/t/trouble-utilizing-webpacker-for-js-in-gem-development/77046/1 "2021-01-26T16:20:55Z")

</div>

Hello all! First time poster here. I am trying to develop a custom rails gem and I’m having a harder than expected time understanding how to utilize Webpacker in the dummy app. It appears that this is not supported yet? Suggestions on how to include JS when doing custom gem development?

---

<div class="post-metadata">

**Author:** ![Websitescenes](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/websitescenes/32/2918_2.png) [@Websitescenes](https://discuss.rubyonrails.org/u/Websitescenes)\
**Post date:** [January 26, 2021, 4:50pm UTC](https://discuss.rubyonrails.org/t/trouble-utilizing-webpacker-for-js-in-gem-development/77046/2 "2021-01-26T16:50:35Z")

</div>

I’ll go ahead and respond here. I think my issue is that I was only using a “gemified plugin” as opposed to an engine. I see that I can utilize Webpacker when passing the mountable flag:

```ruby
rails plugin new gem_name --mountable

```

---

<div class="post-metadata">

**Author:** ![walterdavis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/walterdavis/32/705_2.png) [@walterdavis](https://discuss.rubyonrails.org/u/walterdavis)\
**Post date:** [January 26, 2021, 5:42pm UTC](https://discuss.rubyonrails.org/t/trouble-utilizing-webpacker-for-js-in-gem-development/77046/3 "2021-01-26T17:42:13Z")

</div>

The Edge Guides [Webpacker — Ruby on Rails Guides](https://edgeguides.rubyonrails.org/webpacker.html#webpacker-in-rails-engines) suggest that you may want to distribute your non-ruby assets in an NPM module, and add instructions or an installer hook to your gem to get them added to the parent application. I’m hoping this is just a stop-gap along the way to a more robust solution. We’ve been so spoiled by the maturity of the Sprockets system for so long.

Walter
