rollup-plugin-react-scoped-css 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ast.utils.js CHANGED
@@ -30,7 +30,10 @@ var findImplementation = function (program) {
30
30
  if (node.type !== 'ImportDeclaration') {
31
31
  continue;
32
32
  }
33
- if (node.specifiers.some(function (n) { return n.local.name === 'jsxRuntime'; }) || node.source.value === 'react/jsx-runtime') {
33
+ if (node.specifiers.some(function (n) {
34
+ return ['_jsxDEV', 'jsxRuntime'].includes(n.local.name);
35
+ })
36
+ || ['react/jsx-dev-runtime', 'react/jsx-runtime'].includes(node.source.value)) {
34
37
  return jsx_parser_model_1.ParserImplementations.new;
35
38
  }
36
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup-plugin-react-scoped-css",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "A rollup plugin designed to allow scoped css to be run in react (Compatible with vite and rollup)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/ast.utils.ts CHANGED
@@ -22,7 +22,11 @@ const findImplementation = (program: any) => {
22
22
  continue;
23
23
  }
24
24
 
25
- if (node.specifiers.some((n: any) => n.local.name === 'jsxRuntime') || node.source.value === 'react/jsx-runtime') {
25
+ if (
26
+ node.specifiers.some((n: any) =>
27
+ ['_jsxDEV', 'jsxRuntime'].includes(n.local.name))
28
+ || ['react/jsx-dev-runtime', 'react/jsx-runtime'].includes(node.source.value)
29
+ ) {
26
30
  return ParserImplementations.new
27
31
  }
28
32
  }
package/src/index.ts CHANGED
@@ -126,7 +126,6 @@ export default function reactScopedCssPlugin(optionsIn: ReactScopedCssPluginOpti
126
126
  if (!filter(id)) {
127
127
  return;
128
128
  }
129
-
130
129
  if (scopedCssInFileRegex.test(code)) {
131
130
  const importerHash = generateHash(id);
132
131
  const program = this.parse(code)