madhukar Netke
madhukar Netke

Reputation: 21

How to load vue components from imported gem to the lib directory in rails?

We are using Ruby Webpacker for loading JavaScripts in to webpage. currently we have set paths as below in webpacker.yml

  source_path: app/javascript
  source_entry_path: packs
  public_output_path: packs

This works fine and loads all assets from the given path.

Question: In my application, we are trying to load assets from third party library lib/ directory which contains javascript files as shown below folder structure.

How to load asset (file1.vue) from lib directory into packs.

For reference

This is the folder structure currently we have:

-root
 |
 |-app
   |-javascript
     |-packs
       |-[pack files]
 |-lib
   |- app1
      |-app
        |-javascript
          |- shared
            |- components
              |- fields
                |- file1.vue

file1.vue, this file doesn't get load while inspecting assets in the chrome browser under the source tab.

I can not see file content under the fields folder

Webpack folder structure

screenshot

Upvotes: 1

Views: 150

Answers (1)

madhukar Netke
madhukar Netke

Reputation: 21

After installing bundle of imported gem and starting webpack into it then it's worked.

gem update --system

bundle install

run webpack-dev-server

Upvotes: 1

Related Questions