-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(v2): disable transforms on async (#3053)
* transforming async functions is not implemented by buble, so just bypassing it would relieve the pain for now
- Loading branch information
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/docusaurus-theme-live-codeblock/src/custom-buble.js
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,20 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// fork of Buble which removes Buble's large dependency and weighs in | ||
// at a smaller size of ~51kB | ||
// https://github.com/FormidableLabs/react-live#what-bundle-size-can-i-expect | ||
const {transform, features: bubleFeatures} = require('@philpl/buble'); | ||
|
||
// This file is designed to mimic what's written in | ||
// https://github.com/kitten/buble/blob/mini/src/index.js, with custom transforms options, | ||
// so that webpack can consume it correctly. | ||
exports.features = bubleFeatures; | ||
|
||
exports.transform = function customTransform(source, options) { | ||
return transform(source, {...options, transforms: {asyncAwait: 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