From 6106e459a363e2c04f14fdac34e0f90b7ee90905 Mon Sep 17 00:00:00 2001 From: kenve Date: Thu, 20 Dec 2018 16:47:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20demos=20can=E2=80=98t=20be=20opened=20co?= =?UTF-8?q?rrectly=20in=20CodeSandbox=20(#13734)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/theme/template/Content/Demo.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/theme/template/Content/Demo.jsx b/site/theme/template/Content/Demo.jsx index 2226600fdf..e0dce380b1 100644 --- a/site/theme/template/Content/Demo.jsx +++ b/site/theme/template/Content/Demo.jsx @@ -169,12 +169,12 @@ export default class Demo extends React.Component { const dependencies = sourceCode.split('\n').reduce( (acc, line) => { const matches = line.match(/import .+? from '(.+)';$/); - if (matches && matches[1]) { + if (matches && matches[1] && !line.includes('antd')) { acc[matches[1]] = 'latest'; } return acc; }, - { react: 'latest', 'react-dom': 'latest' }, + { react: 'latest', 'react-dom': 'latest', antd: 'latest' }, ); const codesanboxPrefillConfig = { files: {