Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(toolchain): fixes storybook static build
Browse files Browse the repository at this point in the history
  • Loading branch information
fox1t committed Oct 4, 2019
1 parent 5ece2f8 commit a72d9fb
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ package-lock.json
storybook-static
yarn.lock
pnpm-lock.yaml
/stories/*.d.ts
/stories/**/*.d.ts
/src/**/*.d.ts
8 changes: 7 additions & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { TsConfigPathsPlugin } = require('awesome-typescript-loader')
const webpack = require('webpack')
const path = require('path')

console.log('CUZZOCZZO')
module.exports = async ({ config, mode }) => {
config.module.rules.push({
test: /\.tsx?$/,
Expand All @@ -15,7 +17,11 @@ module.exports = async ({ config, mode }) => {
],
})
config.resolve.extensions = ['.ts', '.tsx', '.js', '.jsx']
config.resolve.plugins = [new TsConfigPathsPlugin({})]
config.resolve.plugins = [
new TsConfigPathsPlugin({
configFileName: path.resolve(__dirname, '../stories/tsconfig.json'),
}),
]
config.plugins.push(
new webpack.DefinePlugin({
__DEV__: process.env.NODE_ENV === 'development',
Expand Down
2 changes: 1 addition & 1 deletion stories/badges.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { storiesOf } from '@storybook/react'

import { Badge } from '@hospitalrun/components'
import { Badge } from '../src'

storiesOf('Badge', module)
.addParameters({
Expand Down
2 changes: 1 addition & 1 deletion stories/buttons.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { Button } from '@hospitalrun/components'
import { Button } from '../src'

storiesOf('Buttons', module)
.addParameters({
Expand Down
2 changes: 1 addition & 1 deletion stories/confirm.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { storiesOf } from '@storybook/react'

import { Confirm } from '@hospitalrun/components'
import { Confirm } from '../src'
import Button from 'react-bootstrap/Button'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'react-confirm-alert/src/react-confirm-alert.css'
Expand Down
2 changes: 1 addition & 1 deletion stories/graphs.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { storiesOf } from '@storybook/react'

import { LineGraph, PieGraph, BarGraph } from '@hospitalrun/components'
import { LineGraph, PieGraph, BarGraph } from '../src'

storiesOf('Graphs', module)
.addParameters({
Expand Down
2 changes: 1 addition & 1 deletion stories/icons.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { storiesOf } from '@storybook/react'

import { Icon } from '@hospitalrun/components'
import { Icon } from '../src'

storiesOf('Icons', module)
.addParameters({
Expand Down
2 changes: 1 addition & 1 deletion stories/pills.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { storiesOf } from '@storybook/react'

import { Pill } from '@hospitalrun/components'
import { Pill } from '../src'

storiesOf('Pill', module)
.addParameters({
Expand Down
2 changes: 1 addition & 1 deletion stories/spinner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { storiesOf } from '@storybook/react'

import { Spinner } from '@hospitalrun/components'
import { Spinner } from '../src'

storiesOf('Spinner', module)
.addParameters({
Expand Down
2 changes: 1 addition & 1 deletion stories/toaster.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'

import { storiesOf } from '@storybook/react'

import { Toast, Toaster } from '@hospitalrun/components'
import { Toast, Toaster } from '../src'
import Button from 'react-bootstrap/Button'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'react-toastify/dist/ReactToastify.min.css'
Expand Down
12 changes: 10 additions & 2 deletions stories/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"extends": "../tsconfig.json",
"include": ["."],
"include": [
"."
],
"compilerOptions": {
"declaration": false
"declaration": false,
"baseUrl": "../",
"paths": {
"../src": [
"../src"
]
}
}
}

0 comments on commit a72d9fb

Please sign in to comment.