To not allow `[ '' ]` as `staticDirs` or `outputDir` argument in `buildStaticStandalone()` method
See original GitHub issueWhen calling to copyAllStaticFiles()
with ['']
as argument (by mistake), it executes and ends up copying root folder and more collateral side effects happening.
Would be nice to throw, or not allow that value at TS level.
I would be happy to PR a fix if you agree on the problem
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
msbuild -p:outputdir=c:\mydir being ignored - Stack Overflow
The MSDN doc for this tool says that I should be able to override the build directory using this parameter. What am I...
Read more >storybookjs/storybook (Raised $170.00) - Issuehunt
To not allow `[ '' ]` as `staticDirs` or `outputDir` argument in `buildStaticStandalone()` method. Unfunded#13860created byoscard0m.
Read more >CLI options - Storybook
configure/telemetry.md#how-to-opt-out) if you'd not like to share any information. Pass these commands the following options to alter Storybook's behavior.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
~Apparently I’m not able to exactly try my changes due to this line~
~No matter if I pass it through
package.json
orcli arg
, an empty string''
will be falsy in this line and will fallback to./storybook-static
~~Checking this code, an idea coming to my mind: Should this fallback
./storybook/static
added insidebuildStatcStandalone()
instead?~Checked the code more deeply and apparently the line of code added in https://github.com/storybookjs/storybook/pull/13969 is just deffensive code for
outputDir
prop because any call tostandalone
buildStatics will be protected by:https://github.com/storybookjs/storybook/blob/0327cae8b8330b4206158b765d87bbfe43f15b89/lib/core-server/src/build-static.ts#L105
It will always fallback to
'./storybook-static'
What needs an extra protection is
staticDir
which doesn’t have a fallback. Actions I would take are:'./.storybook'
could be interestingstaticDir
empty string. The original purpose of this issueLet me know if you agree on it @shilman and how you would like to manage the revert + unit tests PR’s first
@oscard0m The other PR broke it. I’ll should be able to put out a fix today. Thanks for the heads up! The command line should still work