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

Absolute paths for config files don't work #326

Open
gcoombe opened this issue Jul 25, 2019 · 2 comments
Open

Absolute paths for config files don't work #326

gcoombe opened this issue Jul 25, 2019 · 2 comments

Comments

@gcoombe
Copy link

gcoombe commented Jul 25, 2019

Do you want to request a feature or report a bug?

Report bug

What is the current behavior?

Due to how cosmicConfig is being used specifying an absolute path to a config file does't work. When specifying a --config arg the value is passed into searchPlaces. However this is meant to be a place that cosmicConfig looks at each level as it traverses up the directory not a path.

Something like --config ../foo.config.js also doesn't work

If the current behavior is a bug, please provide the steps to reproduce.

To repro:

  • Try something like bundlesize --config ../foo.json or bundlesize --config /Users/gcoombe/apps/bundlesize.json

What is the expected behavior?

Absolute paths or relative paths not within the cwd or subdirectory should work,

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention other relevant information.
-Bundlesize@0.18.0

@gcoombe
Copy link
Author

gcoombe commented Jul 25, 2019

I can try and submit a PR but it seems like if we're specifying a config arg we should just treat it like a path and not use cosmicConfig. I'm not sure what we're attempting to gain with this dependency.

@siddharthkp
Copy link
Owner

siddharthkp commented Jul 26, 2019

Part 1: Verified that absolute path doesn't work. (cosmic-config prepends the current directory to path)

Part 2: I was able to make --config ../foo.config.js work, check out the tests in #327. Can you create a small reproduction repo for this? (Or modify the tests to reproduce this)

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

No branches or pull requests

2 participants