mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
8e27cf986f
* chore: rm component less file * refactor: less file * refactor: rm less * refactor: rm page-header and comment * chore: rm less in components * chore: update dist config * chore: update image test * chore: update dekko * chore: rm lib dekko * chore: update dist dekko * chore: udpate bundle size * test: update snapshot * test: rm theme test * test: update snapshot * test: update snapshot * chore: copy reset.css * test: update image test * chore: copy reset.css to es * chore: update site script
30 lines
916 B
JavaScript
30 lines
916 B
JavaScript
/* eslint no-console:0 */
|
|
function pascalCase(name) {
|
|
return name.charAt(0).toUpperCase() + name.slice(1).replace(/-(\w)/g, (m, n) => n.toUpperCase());
|
|
}
|
|
|
|
// Import all the component less file.
|
|
// This is mostly like index.js but we do not need root `themes/index`
|
|
const req = require.context('../components', true, /^\.\/[^_][\w-]+\/style\/index\.less$/);
|
|
|
|
req.keys().forEach(mod => {
|
|
let v = req(mod);
|
|
if (v && v.default) {
|
|
v = v.default;
|
|
}
|
|
const match = mod.match(/^\.\/([^_][\w-]+)\/index\.less$/);
|
|
if (match && match[1]) {
|
|
if (match[1] === 'message' || match[1] === 'notification') {
|
|
// message & notification should not be capitalized
|
|
exports[match[1]] = v;
|
|
} else {
|
|
exports[pascalCase(match[1])] = v;
|
|
}
|
|
}
|
|
});
|
|
|
|
// Need import for the additional core style
|
|
exports.styleCore = require('../components/style/reset.css');
|
|
|
|
module.exports = require('../components');
|