Skip to content

Add instructions for including 3rd party packages in bundle #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ Watch out - if you precompile your files locally, those will be served over the
rails assets:clobber
```

### How do I include 3rd party stylesheets from `node_modules` in my bundle?

Use an `@import` statement and path to a specific stylesheet, omitting the `node_modules/` segment and the file's extension. For example:

```scss
/* Desired file is at at node_modules/select2/dist/css/select2.css */
@import "select2/dist/css/select2";
```

## License

CSS Bundling for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).