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

Commit

Permalink
Merge pull request #35 from ripe-tech/ms/fix-vercel-storybook
Browse files Browse the repository at this point in the history
Storybook route
  • Loading branch information
joamag authored Nov 6, 2020
2 parents eca9e44 + a991b0c commit 8f0a948
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/plugin-transform-runtime": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@storybook/addon-knobs": "^6.0.28",
"@storybook/addon-storysource": "^6.0.28",
Expand Down Expand Up @@ -101,7 +102,7 @@
"vue-loader": "^15.9.5",
"vue-styleguidist": "^4.33.5",
"vue-template-compiler": "^2.6.12",
"webpack": "^5.4.0",
"webpack": "^4.44.2",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0"
},
Expand Down
44 changes: 43 additions & 1 deletion styleguide.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,48 @@
const config = require("./webpack.config");

// remove babel-loader rule and replace it with one that includes
// the regeneratorRuntime
config.module.rules = config.module.rules.filter(rule => String(rule.test) !== String(/\.js$/));
config.module.rules.push({
test: /\.js$/,
exclude: /node_modules\/(?!ripe-sdk)/,
use: [
{
loader: "babel-loader",
options: {
presets: [
process.env.NODE_ENV === "development"
? [
"@babel/preset-env",
{
targets: {
browsers: ["last 2 years"]
},
useBuiltIns: "entry",
corejs: "3"
}
]
: "@babel/preset-env"
],
plugins: [
[
"@babel/plugin-transform-runtime",
{
regenerator: true
}
]
]
}
},
{
loader: "eslint-loader"
}
]
});

module.exports = {
styleguideDir: "dist/styleguide",
webpackConfig: Object.assign({}, require("./webpack.config"), {
webpackConfig: Object.assign({}, config, {
externals: {}
}),
sections: [
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"routes": [
{ "src": "/", "dest": "/storybook/index.html" },
{ "src": "/storybook", "dest": "/storybook/index.html" },
{ "src": "/(?!res)(.*)", "dest": "/styleguide/$1" }
]
}

1 comment on commit 8f0a948

@vercel
Copy link

@vercel vercel bot commented on 8f0a948 Nov 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.