Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0.0alpha] build-storybook no longer supports relative paths #1052

Closed
ajhyndman opened this issue May 18, 2017 · 5 comments
Closed

[3.0.0alpha] build-storybook no longer supports relative paths #1052

ajhyndman opened this issue May 18, 2017 · 5 comments

Comments

@ajhyndman
Copy link
Contributor

It looks like the build-storybook executable is passing a relative path as-is to Webpack 2 as an output location. Webpack 2 seems to require that this be resolved to an absolute path:

https://webpack.js.org/configuration/output/#output-publicpath

I'd like to see the same relative output pathname supported via command line. Nobody wants an absolute path committed in the package.json of their project. I'm hoping this can be resolved programatically inside the webpack config reconciliation?

$ build-storybook -c local_modules/storybook/ -o ./docs/storybook 
@storybook/react v3.0.0-alpha.0

=> Loading custom webpack config (extending mode).
Building storybook ...
/Users/work/Projects/mathspace-1/node_modules/webpack/lib/webpack.js:19
		throw new WebpackOptionsValidationError(webpackOptionsValidationErrors);
		^

WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "./docs/storybook" is not an absolute path!
@chrvadala
Copy link
Contributor

chrvadala commented May 18, 2017

Same problem. A possible workaround is:
"build-storybook": "build-storybook -s public -o ${PWD}/storybook-build"

ajhyndman added a commit to ajhyndman/react-storybook that referenced this issue May 18, 2017
Fixes storybookjs#1052

I've tested this locally and it resolves the issue I encountered.
ndelangen pushed a commit that referenced this issue May 24, 2017
Fixes #1052

I've tested this locally and it resolves the issue I encountered.
@unutoiul
Copy link

how this is is solved? as I still can't have an absolute path in my storybook project.?

@ndelangen
Copy link
Member

@unutoiul Please explain what's you're trying to do, from what I understand in your comment you're trying to do the opposite of the OP.

Here's the fix implemented, by the @ajhyndman himself. (:bow:)
https://github.com/storybooks/storybook/pull/1058/files

Please understand we're just humans here, not mind readers.
If you want your problem to get fixed, the best approach is to be kind and informative.
Cheers! 🍻

@unutoiul
Copy link

Hi,

I'm trying to have absolute path when I import files:

example:

import Test from 'shared-components/components/test/test';

instead of

import Test from './../components/test/test';

Thanks,
Lucas

@ndelangen
Copy link
Member

ndelangen commented Oct 24, 2017

'shared-components/components/test/test'
Is not an absolute path, that's a reference to a npm package called shared-components.

If you want to have some special resolver logic, you need to configure webpack to do so.
https://webpack.js.org/configuration/resolve/
https://storybook.js.org/configurations/custom-webpack-config/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants