forked from unfoldingWord/resource-workspace-rcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyleguide.config.js
45 lines (44 loc) · 1.29 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
const path = require('path');
const upperFirst = require('lodash/upperFirst');
const camelCase = require('lodash/camelCase');
const {
name, version, repository,
} = require('./package.json');
module.exports = {
title: `${upperFirst(camelCase(name))} v${version}`,
ribbon: {
url: repository.url,
text: 'View on GitHub',
},
moduleAliases: { 'resource-workspace-rcl': path.resolve(__dirname, 'src') },
skipComponentsWithoutExample: true,
ignore: ['**/helpers**', '**/styled**', '**/__tests__/**', '**/*.test.{js,jsx,ts,tsx}', '**/*.spec.{js,jsx,ts,tsx}', '**/*.d.ts'],
serverPort: 6003,
exampleMode: 'expand',
usageMode: 'expand',
getComponentPathLine(componentPath) {
const componentName = componentPath.match(/(\w+)\/index.js/)[1];
return `import { ${componentName} } from '${name}';`;
},
webpackConfig: {
//https://github.com/facebook/create-react-app/pull/8079#issuecomment-562373869
devServer: { port: 6003, transportMode: 'ws' },
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
use: [
'style-loader',
{ loader: 'css-loader' },
],
},
],
},
},
};