From 635b993066ef3abe5211c7cc4192e851661b8808 Mon Sep 17 00:00:00 2001 From: Tyler Paige Date: Tue, 9 Jan 2024 10:24:52 -0600 Subject: [PATCH] Add instructions for including 3rd party packages in bundle See discussion in issue #92 https://github.com/rails/cssbundling-rails/issues/92 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index a6c1db4..9e7c24f 100644 --- a/README.md +++ b/README.md @@ -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).