fix: demos can‘t be opened correctly in CodeSandbox (#13734)

pull/13747/head
kenve 6 years ago committed by zombieJ
parent 422b20993b
commit 6106e459a3

@ -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: {

Loading…
Cancel
Save