Storybook: Override webpack revolve not working

Created on 2 Mar 2017  路  7Comments  路  Source: storybookjs/storybook

Hi guys I'm trying to define a webpack resolve in .storybook/webpack.config.js

resolve : { modules : [ path.resolve('./src'), 'node_modules', ], },

In order to use in my styles :
import variables from 'theme/varables';
in the theme folder I have a package.json with
{ "name" : "@theme" }
webpack output :
react storybook 2017-03-01 17-45-11

Any idea?
thanks

compatibility with other tools

All 7 comments

Can we close this issue ?

Let us know if this issue still exist 馃憣 ?

I can confirm this issue still happens. Using babel-plugin-module-resolver seems a quickfix to me, as it implies adding a new plugin only to get storybook working.

Okay for anyone that encounter the same issue: that's because we must use modulesDirectories instead of modules for webpack v1, which Storybook use for the moment (v2.35).
https://webpack.github.io/docs/resolving.html

This would be good to document the fact that Storybook uses webpack v1 (or to insist on it if I actually missed it :) ), as it is deprecated and we find lesser resources using v1 syntax.

Or shall we try to move to Webpack v2? 馃拑

We will move over to webpack 2.

Was this page helpful?
0 / 5 - 0 ratings