Skip to content

Commit 3e7d861

Browse files
authored
Fix issue where babel-plugin would cause other babel plugins to exit early (#41)
1 parent e0ed6c9 commit 3e7d861

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/eighty-queens-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vanilla-extract/babel-plugin': patch
3+
---
4+
5+
Fix issue where babel-plugin would cause other babel plugins to exit early

packages/babel-plugin/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ export default function (): PluginObj<Context> {
203203
ImportDeclaration(path) {
204204
if (!this.isCssFile || this.alreadyCompiled) {
205205
// Bail early if file isn't a .css.ts file or the file has already been compiled
206-
return path.stop();
206+
return;
207207
}
208208

209209
if (path.node.source.value === filescopePackageIdentifier) {
210210
// If file scope import is found it means the file has already been compiled
211211
this.alreadyCompiled = true;
212-
return path.stop();
212+
return;
213213
} else if (path.node.source.value === packageIdentifier) {
214214
path.node.specifiers.forEach((specifier) => {
215215
if (t.isImportNamespaceSpecifier(specifier)) {
@@ -231,7 +231,7 @@ export default function (): PluginObj<Context> {
231231
CallExpression(path) {
232232
if (!this.isCssFile || this.alreadyCompiled) {
233233
// Bail early if file isn't a .css.ts file or the file has already been compiled
234-
return path.stop();
234+
return;
235235
}
236236

237237
const { node } = path;

0 commit comments

Comments
 (0)