-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(test): ensure a regenatorRuntime import is added
- when using transform-runtime with helpers: false, it should import from @babel/runtime/regenerator - either this plugin configured like this or a direct import of regenerator in one's own library code is the only way to get it to be imported - just using a generator will make regenerator code added, but without any import (leading to a ReferenceError) - TODO: make it easier or automatic to use generators - useBuiltIns of preset-env?
- Loading branch information
Showing
4 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
plugins: [ | ||
'styled-components' | ||
'styled-components', | ||
['@babel/plugin-transform-runtime', { helpers: false }], | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function* testGenerator() { | ||
return yield 'blah'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters