mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 19:50:05 +08:00
fix: demos can‘t be opened correctly in CodeSandbox (#13734)
This commit is contained in:
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…
Reference in New Issue
Block a user