Skip to content

Commit

Permalink
made import attribute support backwards compatible with rollup v3
Browse files Browse the repository at this point in the history
  • Loading branch information
jleeson committed Sep 23, 2024
1 parent ef6e7c0 commit 7956da4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export default (options = {}) => {

/* if modules are enabled or an import uses native css module syntax, export it as a CSSStyleSheet */
const moduleInfo = this.getModuleInfo(id);
if (options.modules || moduleInfo.attributes?.type == "css") {
const attributes = moduleInfo.assertions != undefined ? moduleInfo.assertions : moduleInfo.attributes;
if (options.modules || attributes?.type == "css") {
return {
code: `const sheet = new CSSStyleSheet();sheet.replaceSync(${JSON.stringify(transformedCode)});export default sheet;`,
map: { mappings: "" }
Expand Down

0 comments on commit 7956da4

Please sign in to comment.