ant-design/site/bisheng.config.js
2017-01-20 11:48:38 +08:00

82 lines
1.9 KiB
JavaScript

const path = require('path');
module.exports = {
port: 8001,
source: [
'./components',
'./docs',
'CHANGELOG.zh-CN.md', // TODO: fix it in bisheng
'CHANGELOG.en-US.md',
],
theme: './site/theme',
htmlTemplate: './site/theme/static/template.html',
themeConfig: {
categoryOrder: {
十大原则: 0,
Principles: 0,
设计基础: 1,
'Design Fundamental': 1,
},
typeOrder: {
General: 0,
Layout: 1,
Navigation: 2,
'Data Entry': 3,
'Data Display': 4,
Feedback: 5,
Localization: 6,
Other: 7,
},
docVersions: {
'0.9.x': 'http://09x.ant.design',
'0.10.x': 'http://010x.ant.design',
'0.11.x': 'http://011x.ant.design',
'0.12.x': 'http://012x.ant.design',
'1.x': 'http://1x.ant.design',
},
},
filePathMapper(filePath) {
if (filePath === '/index.html') {
return ['/index.html', '/index-cn.html'];
}
if (filePath.endsWith('/index.html')) {
return [filePath, filePath.replace(/\/index\.html$/, '-cn/index.html')];
}
if (filePath !== '/404.html' && filePath !== '/index-cn.html') {
return [filePath, filePath.replace(/\.html$/, '-cn.html')];
}
return filePath;
},
doraConfig: {
verbose: true,
plugins: ['dora-plugin-upload'],
},
webpackConfig(config) {
config.resolve.alias = {
'antd/lib': path.join(process.cwd(), 'components'),
antd: process.cwd(),
site: path.join(process.cwd(), 'site'),
'react-router': 'react-router/umd/ReactRouter',
};
config.babel.plugins.push([
require.resolve('babel-plugin-transform-runtime'),
{
polyfill: false,
regenerator: true,
},
]);
config.babel.plugins.push([
require.resolve('babel-plugin-import'),
{
style: true,
libraryName: 'antd',
libraryDirectory: 'components',
},
]);
return config;
},
};