Skip to content

Commit

Permalink
Merge pull request #23 from Justineo/fix-inject
Browse files Browse the repository at this point in the history
make style injection more robust
  • Loading branch information
jleeson authored Aug 13, 2024
2 parents 38c9316 + 1cb5999 commit eb26ef3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default (options = {}) => {
/* if inject is enabled, we want to simply inject the stylesheet into the document head */
if (options.inject) {
return {
code: `document.head.innerHTML += ${JSON.stringify(`<style>${transformedCode}</style>`)};`,
code: `document.head.appendChild(document.createElement('style')).textContent=${JSON.stringify(transformedCode)};`,
map: { mappings: "" }
};
}
Expand Down

0 comments on commit eb26ef3

Please sign in to comment.