-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyleguide.config.js
75 lines (71 loc) · 1.58 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
const path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
const PnpWebpackPlugin = require(`pnp-webpack-plugin`)
const { NODE_ENV } = process.env
const isDev = NODE_ENV === 'development'
module.exports = {
title: 'Spartan UI',
styleguideDir: 'docs',
sections: [
{
name: 'About',
content: path.resolve(__dirname, 'README.md'),
},
{
name: 'Components',
components: ['src/components/**/[A-Z]*.{js,jsx,ts,tsx}'],
},
],
propsParser: require('react-docgen-typescript').parse,
template: {
head: {
links: [
{
rel: 'stylesheet',
href:
'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap-reboot.min.css',
},
],
},
},
webpackConfig: {
devtool: isDev && 'inline-source-map',
module: {
rules: [
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
loader: require.resolve('babel-loader'),
},
{
test: /\.tsx?$/,
use: require.resolve('ts-loader'),
exclude: /node_modules/,
},
],
},
plugins: [
new CopyPlugin([
{ from: path.resolve(__dirname, 'site', 'assets'), to: 'assets' },
]),
],
resolveLoader: {
plugins: [PnpWebpackPlugin.moduleLoader(module)],
},
resolve: {
extensions: [
'web.mjs',
'mjs',
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
],
plugins: [PnpWebpackPlugin],
},
},
}