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

Alternative locations for configuration file #401

Closed
Mugen87 opened this issue Jun 5, 2018 · 3 comments · Fixed by #418
Closed

Alternative locations for configuration file #401

Mugen87 opened this issue Jun 5, 2018 · 3 comments · Fixed by #418

Comments

@Mugen87
Copy link

Mugen87 commented Jun 5, 2018

We are using serve as our local dev server for three.js. After upgrading to the latest version, I've realized we need cleanUrls set to false so our documentation still works with serve. The problem is now we don't want to pollute the root directory of the repo with even more files (see mrdoob/three.js#14210). Is there a different way to pass in the mentioned configuration?

@donmccurdy
Copy link

donmccurdy commented Jun 5, 2018

+1, I use serve on a number of projects and cleanUrls=true seems like a very unexpected default setting to me. Adding another config file to the root of my projects would be nice to avoid. Some non-mutually exclusive alternatives:

  • Default to false as before
  • Allow configuration through a serve property in package.json
  • Allow setting the config file through a CLI parameter, like serve --config scripts/serve.json so developers can keep the top-level project clean
  • Provide a CLI parameter like serve --no-clean-urls

@leo
Copy link
Contributor

leo commented Jun 11, 2018

I would be happy to accept a PR for --config <path>... 😊 👍

@tohjustin
Copy link
Contributor

Hi everyone, here's my naive attempt in implementing the --config flag.

  • The current implementation just accepts a raw String without any form of checks in place.
    • Running serve -c script/myServeConfig.json would work
    • Should we be enforcing a rule that serve's configuration can only be contained in an external file named serve.json? (other than now.json or package.json)
  • Should I be throwing an error if a file at <CUSTOM-PATH>/serve.json does not exists?
    • In this case mentioned above, currently serve will ignore it & attempt to parse other possible places containing the configurations in the following order: serve.json --> now.json --> package.json.

Would love to hear feedback from you guys 😅

@leo leo closed this as completed in #418 Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants