From be6aa15102b39e0f341253fe8e8695cb993fed4d Mon Sep 17 00:00:00 2001 From: Ely De La Cruz <603428+elycruz@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:45:25 -0400 Subject: [PATCH] feat: issue-#158 - insert feat docs - Notes on using 'insert' in different scenarios. --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44ab8ec..af25040 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,8 @@ sass({ + Type: `Boolean` _(default: false)_ -If you specify `true`, the plugin will insert compiled CSS into `` tag. +If you specify `true`, the plugin will insert compiled CSS into `` tag, via utility function that it will output +in your build bundle. ```js sass({ @@ -92,6 +93,17 @@ sass({ }) ``` +**Usage caveat:** + +There is a utility function that handles injecting individual style payloads into the page's head, which is output as `___$insertStyle` by the rollup-plugin-sass plugin. + +This function is output to `./dist/node_modules/...`, in user-land builds, so you have to make sure that it isn't +ignored by your build tool(s) (E.g., rollup, webpack etc.); As a solution, you'll just have to make sure that the +directory is "included"/not-"excluded" via your build tools facilities/added-plugins/etc. + +Additionally, if you're publishing an app to an internal registry, or similar, you'll have to +make sure 'dist/node_modules' isn't ignored in this scenario as well. + ### `processor` + Type: `Function`