houdini/.storybook/main.js

29 lines
861 B
JavaScript
Raw Normal View History

2020-06-23 21:49:46 +00:00
// License: LGPL-3.0-or-later
// Based on https://github.com/rails/webpacker/issues/1004#issuecomment-628377930
process.env.NODE_ENV = "development";
const railsWebpackEnv = require("../config/webpack/environment");
module.exports = {
2020-06-23 21:49:46 +00:00
stories: ["../app/javascript/stories/*.[tj]s?(x)"],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
2020-06-23 21:49:46 +00:00
webpackFinal: (config) => ({
// do mutation to the config
2020-06-23 21:49:46 +00:00
...config,
resolve: {
...config.resolve,
...railsWebpackEnv.config.resolve,
modules: railsWebpackEnv.resolvedModules.map((i) => i.value),
},
module: {
...config.module,
rules: railsWebpackEnv.loaders
.filter((i) => i.key !== "nodeModules")
.map((i) => i.value),
},
plugins: [
...config.plugins,
...railsWebpackEnv.plugins.map((i) => i.value),
],
}),
};