docs: enable components tree-shaking (#43777)

This commit is contained in:
MadCcc 2023-07-25 11:53:28 +08:00 committed by GitHub
parent 23671fda84
commit c713606b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

@ -1,4 +0,0 @@
// Need import for the additional core style
// exports.styleCore = require('../components/style/reset.css');
module.exports = require('../../components');

View File

@ -30,8 +30,7 @@ export default defineConfig({
'antd/lib': path.join(__dirname, 'components'),
'antd/es': path.join(__dirname, 'components'),
'antd/locale': path.join(__dirname, 'components/locale'),
// Change antd from `index.js` to `.dumi/theme/antd.js` to remove deps of root style
antd: require.resolve('./.dumi/theme/antd.js'),
antd: path.join(__dirname, 'components'),
},
extraRehypePlugins: [rehypeAntd],
extraRemarkPlugins: [remarkAntd],