This repository has been archived by the owner on Aug 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathdoczrc.js
113 lines (108 loc) · 2.77 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* Docz Configuration File:
* https://www.docz.site/docs/project-configuration
*/
import { css } from 'docz-plugin-css';
export default {
dest: 'example/build',
public: '/public',
wrapper: 'src/__docs__/wrapper',
indexHtml: 'src/__docs__/index.html',
// Limited support for importing `.styl` files
codeSandbox: false,
// https://github.com/pedronauck/docz/pull/849/files
// Because we re-export using `index.js` files
notUseSpecifiers: true,
// filterComponents: files =>
// files.filter(filepath =>
// /\/[A-Z]\w*(\/index)?\.(js|jsx|ts|tsx)$/.test(filepath)
// ),
menu: [
'Introduction',
'Getting Started',
{ name: 'Elements', menu: ['Form / Select'] },
{
name: 'Components',
menu: [
'CINE Dialog',
'Layout Button',
'Measurement Table',
'Overlay Trigger',
'Quick Switch',
'Rounded Button Group',
'Select Tree',
'Simple Dialog',
'Study Browser',
'Study List',
'Table List',
'Toolbar Section',
'About Modal',
'User Preferences Modal',
],
},
'Styling & Theming',
'Translating',
'Compatibility',
],
// Rollup Aliases?
// https://github.com/pedronauck/docz/issues/373
plugins: [
// CSS
css(),
// Stylus
css({
preprocessor: 'stylus',
cssmodules: false,
}),
],
// `docz` uses file-loader to pull in SVGs. This kills our icons before
// They can be picked up by our `babel-plugin-inline-react-svg` dependency
// You can see where it's configured here:
// https://github.com/pedronauck/docz/blob/f72624d0aa5231dab17e1770e8d36be920f590a2/core/docz-core/src/bundler/loaders.ts#L135-L144
// How we delete our rule:
// https://github.com/neutrinojs/webpack-chain/issues/48
onCreateWebpackChain: config => {
config.module.rules.delete('svg');
// config.module
// .rule('svg')
// .test(/\.(svg)(\?.*)?$/)
// .use('file-loader')
// .loader(require.resolve('file-loader'))
// .options({
// name: `static/img/[name].[ext]`,
// })
},
modifyBabelRc: babelrc => {
const newBabelRc = {
...babelrc,
plugins: [
...babelrc.plugins,
require.resolve('babel-plugin-inline-react-svg'),
],
};
return newBabelRc;
},
};
/*
* Alternative ways to extend/modify underlying webpack config
*
modifyBundlerConfig: (config) => {
config.module.rules.push({
test: /\.scss$/,
use: ["style-loader", "css-loader", "sass-loader"]
})
return config
}
*
*
*
onCreateWebpackChain: config => {
config.module
.rule('css')
.test(/\.css$/)
.use('css-loader')
.loader('css-loader')
.options({ sourceMap: false,
importLoaders: 2 })
}
*/