Repository navigation
Expand file tree
/
Copy pathstyleguide.config.js
More file actions
59 lines (54 loc) · 1.81 KB
/
Copy pathstyleguide.config.js
File metadata and controls
59 lines (54 loc) · 1.81 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
const glob = require('glob')
const path = require('path')
const srcPath = path.resolve(__dirname, 'src')
const docsPath = path.resolve(__dirname, 'docs')
const getDocFiles = () => glob.sync(path.join(__dirname, 'docs', '*.md')).map((filePath) => {
const filename = filePath.slice(docsPath.length + 1, filePath.length - '.md'.length )
console.log('Adding', filename + '.md to the docs');
return ({
name: filename,
content: `./docs/${filename}.md`
})
})
module.exports = {
title: 'react-leaflet-hotline',
pagePerSection: true,
exampleMode: 'expand',
skipComponentsWithoutExample: true,
styleguideDir: 'dist-docs',
sections: [
// { name: 'Introduction', content: './docs/Introduction.md', sectionDepth: 1 },
// { name: 'Installation', content: './docs/Installation.md', sectionDepth: 1 },
...getDocFiles()
],
require: [path.join(docsPath, 'utils', '_setup.js'), path.join(docsPath, 'utils', '_custom.css')],
webpackConfig() {
return {
resolve: {
alias: { 'react-leaflet-hotline': srcPath }
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader']
},
{
test: /\.png$/,
loader: 'url-loader'
}
]
}
}
},
}