tweak storybook webpack

This commit is contained in:
AllenFang 2018-01-21 16:10:55 +08:00
parent a2d082babf
commit 2263282629
4 changed files with 11 additions and 10 deletions

View File

@ -1,3 +1,4 @@
{ {
"presets": ["react", "es2015", "stage-0", ["env", {"modules": false} ]] "presets": ["react", "es2015", "stage-0", ["env", {"modules": false} ]],
"plugins": ["transform-class-properties"]
} }

View File

@ -1,10 +1,10 @@
const path = require('path'); const path = require('path');
const sourcePath = path.join(__dirname, '../../react-bootstrap-table2'); const sourcePath = path.join(__dirname, '../../react-bootstrap-table2/index.js');
const paginationSourcePath = path.join(__dirname, '../../react-bootstrap-table2-paginator'); const paginationSourcePath = path.join(__dirname, '../../react-bootstrap-table2-paginator/index.js');
const overlaySourcePath = path.join(__dirname, '../../react-bootstrap-table2-overlay'); const overlaySourcePath = path.join(__dirname, '../../react-bootstrap-table2-overlay/index.js');
const filterSourcePath = path.join(__dirname, '../../react-bootstrap-table2-filter'); const filterSourcePath = path.join(__dirname, '../../react-bootstrap-table2-filter/index.js');
const editorSourcePath = path.join(__dirname, '../../react-bootstrap-table2-editor'); const editorSourcePath = path.join(__dirname, '../../react-bootstrap-table2-editor/index.js');
const sourceStylePath = path.join(__dirname, '../../react-bootstrap-table2/style'); const sourceStylePath = path.join(__dirname, '../../react-bootstrap-table2/style');
const paginationStylePath = path.join(__dirname, '../../react-bootstrap-table2-paginator/style'); const paginationStylePath = path.join(__dirname, '../../react-bootstrap-table2-paginator/style');
const storyPath = path.join(__dirname, '../stories'); const storyPath = path.join(__dirname, '../stories');
@ -33,8 +33,7 @@ const loaders = [{
}, { }, {
test: /\.js?$/, test: /\.js?$/,
use: ['babel-loader'], use: ['babel-loader'],
exclude: /node_modules/, exclude: /node_modules/
include: [sourcePath, paginationSourcePath, overlaySourcePath, filterSourcePath, editorSourcePath, storyPath]
}, { }, {
test: /\.css$/, test: /\.css$/,
use: ['style-loader', 'css-loader'], use: ['style-loader', 'css-loader'],

View File

@ -23,6 +23,7 @@
"devDependencies": { "devDependencies": {
"@storybook/addon-console": "^1.0.0", "@storybook/addon-console": "^1.0.0",
"@storybook/react": "^3.2.8", "@storybook/react": "^3.2.8",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"react-redux": "^5.0.6", "react-redux": "^5.0.6",
"redux": "^3.7.2", "redux": "^3.7.2",

View File

@ -96,8 +96,8 @@ import RemoteAll from 'examples/remote/remote-all';
import 'bootstrap/dist/css/bootstrap.min.css'; import 'bootstrap/dist/css/bootstrap.min.css';
import 'stories/stylesheet/tomorrow.min.css'; import 'stories/stylesheet/tomorrow.min.css';
import 'stories/stylesheet/storybook.scss'; import 'stories/stylesheet/storybook.scss';
import 'react-bootstrap-table2/style/react-bootstrap-table2.scss'; import '../../react-bootstrap-table2/style/react-bootstrap-table2.scss';
import 'react-bootstrap-table2-paginator/style/react-bootstrap-table2-paginator.scss'; import '../../react-bootstrap-table2-paginator/style/react-bootstrap-table2-paginator.scss';
// import { action } from '@storybook/addon-actions'; // import { action } from '@storybook/addon-actions';