diff --git a/packages/docusaurus/src/babel/preset.ts b/packages/docusaurus/src/babel/preset.ts index 3dd351ef9ac5c..3f92315190834 100644 --- a/packages/docusaurus/src/babel/preset.ts +++ b/packages/docusaurus/src/babel/preset.ts @@ -16,6 +16,7 @@ function getTransformOptions(isServer: boolean): TransformOptions { // All optional newlines and whitespace will be omitted when generating code // in compact mode compact: true, + sourceType: 'module', presets: [ isServer ? [