Experimenting with generating doc for ui component

This commit is contained in:
Dominik Prokop
2019-01-16 10:27:09 +01:00
parent 2991b64b60
commit 6d3e6b1fcb
9 changed files with 1891 additions and 1835 deletions

View File

@@ -1,8 +1,9 @@
import { configure } from '@storybook/react';
import '../../../public/sass/grafana.dark.scss';
import '@grafana/ui/src/components/index.scss';
// automatically import all files ending in *.stories.tsx
const req = require.context('../stories', true, /.story.tsx$/);
const req = require.context('../src/components', true, /.story.tsx$/);
function loadStories() {
req.keys().forEach(req);

View File

@@ -1,6 +1,7 @@
const path = require('path');
module.exports = (baseConfig, env, config) => {
config.module.rules.push({
test: /\.(ts|tsx)$/,
use: [
@@ -9,6 +10,7 @@ module.exports = (baseConfig, env, config) => {
},
],
});
config.module.rules.push({
test: /\.scss$/,
use: [
@@ -34,6 +36,21 @@ module.exports = (baseConfig, env, config) => {
{ loader: 'sass-loader', options: { sourceMap: false } },
],
});
config.module.rules.push({
test: require.resolve('jquery'),
use: [
{
loader: 'expose-loader',
query: 'jQuery',
},
{
loader: 'expose-loader',
query: '$',
},
],
});
config.resolve.extensions.push('.ts', '.tsx');
return config;
};