Skip to content

Feature/emotion #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 12, 2020
Prev Previous commit
Next Next commit
configure storybook with emotion
  • Loading branch information
ShMcK committed Jan 12, 2020
commit fb0dd7cba805205b0a44f56a4998f019e353604c
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/camelcase': 'off',
'react/forbid-component-props': [1, { forbid: ['style'] }],
'react/forbid-dom-props': [1, { forbid: ['style'] }],
},
};
}
12 changes: 0 additions & 12 deletions web-app/.storybook/.babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion web-app/.storybook/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { configure } from '@storybook/react'
import '../src/styles/index.css'
// import '../src/styles/index.css'

// setup acquireVsCodeApi mock
// @ts-ignore
Expand Down
17 changes: 15 additions & 2 deletions web-app/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

// see typescript setup
// https://storybook.js.org/docs/configurations/typescript-config/
module.exports = ({ config }) => {
config.module.rules.push({
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
include: path.resolve(__dirname, '../'),
})
config.module.rules.push({
test: /\.(ts|tsx)$/,
loader: require.resolve('babel-loader'),
options: {
presets: [['react-app', { flow: false, typescript: true }]],
plugins: [
[
'babel-plugin-import',
{
libraryName: '@alifd/next',
style: true,
},
],
],
presets: [['react-app', { flow: false, typescript: true }], ['@emotion/babel-preset-css-prop']],
},
})

config.plugins.push(new MiniCssExtractPlugin({ filename: '[name].css' }))

config.resolve.extensions.push('.ts', '.tsx')

config.resolve.modules = ['node_modules', path.resolve(__dirname, '../src')]
Expand Down
Loading