Skip to content

Commit

Permalink
fix(babel): do not parse json as js (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcover committed Mar 25, 2023
1 parent 2d6dc0b commit a62e7ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/unlucky-worms-complain.md
@@ -0,0 +1,5 @@
---
'@linaria/babel-preset': patch
---

Avoid parsing json as js
2 changes: 1 addition & 1 deletion packages/babel/src/transform-stages/1-prepare-for-eval.ts
Expand Up @@ -118,7 +118,7 @@ function prepareCode(
originalCode
);

if (action === 'ignore') {
if (action === 'ignore' || filename.endsWith('.json')) {
log('stage-1:ignore', '');

return [originalCode, null];
Expand Down

0 comments on commit a62e7ba

Please sign in to comment.