Browse Source

Fix codepen error for react@16 and moment, close #11886

pull/11893/head
afc163 6 years ago
parent
commit
0e1b304513
  1. 8
      site/theme/template/Content/Demo.jsx

8
site/theme/template/Content/Demo.jsx

@ -133,13 +133,15 @@ export default class Demo extends React.Component {
const codepenPrefillConfig = {
title: `${localizedTitle} - Ant Design Demo`,
html,
js: state.sourceCode.replace(/import\s+\{\s+(.*)\s+\}\s+from\s+'antd';/, 'const { $1 } = antd;'),
js: state.sourceCode
.replace(/import\s+\{\s+(.*)\s+\}\s+from\s+'antd';/, 'const { $1 } = antd;')
.replace("import moment from 'moment';", ''),
css: prefillStyle,
editors: '001',
css_external: 'https://unpkg.com/antd/dist/antd.css',
js_external: [
'react@15.x/dist/react.js',
'react-dom@15.x/dist/react-dom.js',
'react@16.x/umd/react.development.js',
'react-dom@16.x/umd/react-dom.development.js',
'moment/min/moment-with-locales.js',
'antd/dist/antd-with-locales.js',
].map(url => `https://unpkg.com/${url}`).join(';'),

Loading…
Cancel
Save