Skip to content

Commit

Permalink
Add namespaced packs feature to readme (#235)
Browse files Browse the repository at this point in the history
* Add namespaced packs feature to readme

* Clarify usage of namespaced packs
  • Loading branch information
gauravtiwari committed Apr 11, 2017
1 parent 1dcc333 commit 0abb821
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Expand Up @@ -84,6 +84,27 @@ app/javascript/calendar/models/month.js

But it could also look a million other ways.

**Note:** You can also namespace your packs using directories, similar to a Rails app.

```
app/javascript/packs/admin/orders.js
app/javascript/packs/shop/orders.js
```

and reference them in your views like this:

```erb
<%# app/views/admin/orders/index.html.erb %>
<%= javascript_pack_tag 'admin/orders' %>
```

and

```erb
<%# app/views/shop/orders/index.html.erb %>
<%= javascript_pack_tag 'shop/orders' %>
```

## Advanced Configuration

By default, webpacker offers simple conventions for where the webpack configs, javascript app files and compiled webpack bundles will go in your rails app,
Expand Down

0 comments on commit 0abb821

Please sign in to comment.