Skip to content

Commit

Permalink
Upgrade storybook to 5.0, babel 6 to babel 7 (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
janette authored and fmizzell committed Mar 11, 2019
1 parent 5d87c8c commit 7d7b5ae
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 45 deletions.
33 changes: 30 additions & 3 deletions .babelrc
@@ -1,7 +1,34 @@
{
"presets": [
"es2015",
"stage-0",
"react"
"@babel/react",
"@babel/env"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
}
45 changes: 10 additions & 35 deletions .storybook/webpack.config.js
@@ -1,38 +1,13 @@
const path = require("path");
const genDefaultConfig = require('@storybook/react/dist/server/config/defaults/webpack.config.js');

module.exports = (storybookBaseConfig, configType) => {
// configType has a value of 'DEVELOPMENT' or 'PRODUCTION'

// add our custom loaders
storybookBaseConfig.module.rules.push(
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
sourceMap: true,
},
},
],
},
{
test: /\.(woff|woff2|eot|ttf|svg)$/,
include: path.resolve(__dirname, "../src"),
use: [
{
loader: 'url-loader',
},
{
loader: 'file-loader',
},
],
}
);

return storybookBaseConfig;
module.exports = {
module: {
rules: [
{
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
include: path.resolve(__dirname, '../'),
},
],
},
};
35 changes: 28 additions & 7 deletions package.json
Expand Up @@ -13,14 +13,17 @@
"lib": "npm run clean && babel src -d lib",
"clean": "rm -rf lib && mkdir lib",
"prepublish": "npm run lib",
"storybook": "start-storybook -p 6006"
"storybook": "NODE_PATH=src start-storybook -p 6006"
},
"keywords": [
"react",
"react-component"
],
"dependencies": {
"@babel/core": "^7.3.4",
"babel-loader": "^8.0.5",
"bootstrap": "^4.2.1",
"core-js": "^2.6.5",
"excerpts": "0.0.3",
"html-to-react": "^1.3.4",
"prop-types": "^15.6.2",
Expand All @@ -30,12 +33,30 @@
"styled-components": "^4.1.3"
},
"devDependencies": {
"@storybook/react": "^3.2.4",
"babel-cli": "^6.8.0",
"babel-core": "^6.10.4",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-do-expressions": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-bind": "^7.0.0",
"@babel/plugin-proposal-function-sent": "^7.0.0",
"@babel/plugin-proposal-json-strings": "^7.0.0",
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@storybook/addon-actions": "^5.0.0",
"@storybook/addon-links": "^5.0.0",
"@storybook/addons": "^5.0.0",
"@storybook/react": "^5.0.0",
"css-loader": "^2.1.0",
"eslint": "^5.12.1",
"eslint-config-airbnb": "^17.1.0",
Expand Down

0 comments on commit 7d7b5ae

Please sign in to comment.