From b28056354caf3fa347a728bb28a587a9733e0b8c Mon Sep 17 00:00:00 2001 From: bpeab Date: Sun, 1 Dec 2019 22:44:43 +0100 Subject: [PATCH] Resolve #8884 by transpiling acorn-jsx --- addons/docs/src/frameworks/common/preset.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/docs/src/frameworks/common/preset.ts b/addons/docs/src/frameworks/common/preset.ts index 002e5555f282..79a1a84ebaf8 100644 --- a/addons/docs/src/frameworks/common/preset.ts +++ b/addons/docs/src/frameworks/common/preset.ts @@ -44,6 +44,18 @@ export function webpack(webpackConfig: any = {}, options: any = {}) { ...module, rules: [ ...(module.rules || []), + { + test: /\.js$/, + include: /node_modules\/acorn-jsx/, + use: [ + { + loader: 'babel-loader', + options: { + presets: [[require.resolve('@babel/preset-env'), { modules: 'commonjs' }]], + }, + }, + ], + }, { test: /\.(stories|story).mdx$/, use: [