Skip to content

Commit

Permalink
feat: issue-#158 - insert feat docs
Browse files Browse the repository at this point in the history
- Simplified the usage notice
  and added link to 'package.json.files'
  docs.
  • Loading branch information
elycruz committed Sep 25, 2024
1 parent ea8e55c commit 4e44ce9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,17 @@ sass({
**Note:**

The utility function responsible for injecting style chunks into the page's head is output to
`./dist/node_modules/rollup-plugin-sass/dist/...`
`./dist/node_modules/...` (depending on the build tool you're using) when using rollup-plugin-sass's
`insert` feature.

- If publishing a package ensure the above mentioned directory (or similar) is
listed in [`package.json.files`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files) field.
- Additionally, ensure the same directory is not excluded via your build tools (rollup, webpack, etc.),
if you're getting errors related to the `___$insertStyle` function not being present.
Due to this some caveats come up:

1. If you're publishing, and/or packaging-up, an app:
- Ensure the `./{target-dist}/**/node_modules**/insertStyle.js` file is not listed in relevant `.*ignore` files.
- Ensure the `./{target-dist}/**/insertStyle.js` file is listed in [`package.json.files`](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#files) field.
- Additionally, ensure the same directory is not excluded via your build tools (rollup, webpack, etc.).
- Optionally, if you're using typescript, you can list the `./{target-dist}/**/insertStyle` module
in your `*tsconfig*`.

### `processor`

Expand Down

0 comments on commit 4e44ce9

Please sign in to comment.