-
Notifications
You must be signed in to change notification settings - Fork 3
/
styleguide.config.js
107 lines (106 loc) · 2.68 KB
/
styleguide.config.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
const path = require('path');
const { version } = require('./package.json');
module.exports = {
version,
template: {
favicon: 'images/favicon.png',
},
assetsDir: 'src/',
styleguideDir: 'styleguide-build',
require: [
path.join(__dirname, 'src/themes/default/examples.scss'),
path.join(__dirname, 'src/styleguidist/styleguidist.css'),
'ol/ol.css',
'react-app-polyfill/ie11',
'react-app-polyfill/stable',
'abortcontroller-polyfill/dist/abortcontroller-polyfill-only',
],
ribbon: {
url: 'https://github.com/geops/react-transit',
text: 'Fork me on GitHub',
},
moduleAliases: {
'react-transit': path.resolve(__dirname, 'src'),
},
sections: [
{
name: '',
context: 'README.md',
},
{
name: 'Components',
components: [
'src/components/RouteSchedule/[A-Z]*.js',
'src/components/Search/Search.js',
'src/components/TrackerControl/[A-Z]*.js',
],
exampleMode: 'collapse',
usageMode: 'collapse',
},
],
webpackConfig: {
module: {
rules: [
// Babel loader, will use your project’s .babelrc
// Transpile node dependencies, node deps are often not transpiled for IE11
{
test: [
/\/node_modules\/(regexpu-core|unicode-.*|chalk|acorn-.*|query-string|strict-uri-encode|javascript-stringify)/,
/\/node_modules\/(split-on-first|react-dev-utils|ansi-styles|jsts|estree-walker|strip-ansi)/,
],
loader: 'babel-loader',
},
// Transpile js
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
// Load css and scss files.
{
test: /\.s?css$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
{
test: /^((?!url).)*\.svg$/,
use: [
{
loader: 'babel-loader',
},
{
loader: 'react-svg-loader',
options: {
jsx: true, // true outputs JSX tags
},
},
],
},
{
test: /\.url\.svg$/,
loader: 'url-loader',
},
{
test: /\.png$/,
use: [
{
loader: 'url-loader',
},
],
},
],
},
},
styles: {
StyleGuide: {
'@global body': {
overflowY: 'hidden',
overflowX: 'hidden',
},
},
},
showSidebar: true,
styleguideComponents: {
ComponentsList: path.join(__dirname, 'src/styleguidist/ComponentsList'),
StyleGuideRenderer: path.join(__dirname, 'src/styleguidist/StyleGuide'),
},
};