-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdoczrc.js
50 lines (44 loc) · 1.32 KB
/
doczrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const fs = require('fs');
const path = require('path');
// Get the list of packages
const packagesPath = path.resolve(__dirname, './packages');
const packages = fs
.readdirSync(packagesPath)
.filter(f => fs.statSync(path.join(packagesPath, f)).isDirectory());
const emotionPackages = [
'cache',
'core',
'css',
'is-prop-valid',
'sheet',
'styled',
'styled-base',
'stylis',
];
export default {
dest: './docz-static',
base: '/shared-components/documentation/',
title: 'shared-components',
description: 'Shared Components',
ordering: 'ascending',
modifyBundlerConfig: config => {
config.resolve.alias = config.resolve.alias || {};
packages.forEach(pkg => {
const packagePath = path.resolve(packagesPath, `${pkg}/src`);
config.resolve.alias[`shared-components-${pkg}`] = packagePath;
config.resolve.alias[`@shared-components/${pkg}$`] = packagePath;
});
// We need to make sure that docz uses its versions of @emotion because
// storybook also has its own versions that are way older.
for (const pkg of emotionPackages) {
config.resolve.alias[
`@emotion/${pkg}`
] = `docz-theme-default/node_modules/@emotion/${pkg}`;
}
config.module.rules.push({
test: /\.css$/,
use: ['style-loader', 'css-loader'],
});
return config;
},
};