forked from GetStream/react-native-activity-feed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyleguide.config.js
More file actions
124 lines (121 loc) · 3.07 KB
/
styleguide.config.js
File metadata and controls
124 lines (121 loc) · 3.07 KB
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
114
115
116
117
118
119
120
121
122
123
124
// @noflow
/* globals __dirname */
/* eslint-env commonjs*/
const path = require('path');
const webpack = require('webpack');
const notBabeledDeps = [
'react-native-safe-area-view',
'react-native-sticky-keyboard-accessory',
'react-native-keyboard-spacer',
];
module.exports = {
title: 'React native activity feeds - Docs',
require: ['babel-polyfill'],
styleguideDir: 'docs',
sortProps: (props) => props,
styleguideComponents: {
PathlineRenderer: path.join(
__dirname,
'src/styleguideComponents/PathlineRenderer.js',
),
},
sections: [
{
name: 'Introduction',
content: 'docs/setup.md',
},
{
name: 'Top Level Components',
content: 'docs/top-level-components.md',
components: [
'src/Context/StreamApp.js',
'src/components/FlatFeed.js',
'src/components/NotificationFeed.js',
'src/components/SinglePost.js',
],
exampleMode: 'collapse',
usageMode: 'expand',
},
{
name: 'UI Components',
content: 'docs/other-components.md',
components: 'src/components/[A-Z]*.js',
ignore: [
'**/FlatFeed.js',
'**/NotificationFeed.js',
'**/SinglePost.js',
'**/CommentsContainer.js',
],
exampleMode: 'collapse',
usageMode: 'expand',
},
{
name: 'Cookbook',
content: 'docs/cookbook.md',
},
{
name: 'Internationalisation (i18n)',
content: 'docs/Streami18n.md',
},
{
name: 'Styles',
content: 'docs/styles.md',
},
],
template: {
favicon: 'https://getstream.imgix.net/images/favicons/favicon-96x96.png',
},
webpackConfig: {
resolve: {
// auto resolves any react-native import as react-native-web
alias: { 'react-native': 'react-native-web' },
extensions: ['.web.js', '.js'],
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
include: [
path.join(__dirname, 'src'),
...notBabeledDeps.map((dep) =>
path.join(__dirname, 'node_modules', dep),
),
],
options: {
plugins: [
'macros',
'@babel/plugin-transform-runtime',
'@babel/proposal-class-properties',
'@babel/proposal-object-rest-spread',
'react-native-web',
],
presets: ['@babel/env', 'module:metro-react-native-babel-preset'],
babelrc: false,
},
},
{
test: /\.(jpe?g|png|gif|ttf)$/i,
use: [
{
loader: 'file-loader',
options: {
hash: 'sha512',
digest: 'hex',
name: '[hash].[ext]',
outputPath: 'build/images',
},
},
],
},
],
},
// Most react native projects will need some extra plugin configuration.
plugins: [
// Add __DEV__ flag to browser example.
new webpack.DefinePlugin({
__DEV__: process.env,
}),
],
},
};