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

The --root option is lost on configuration updates and restarts #5985

Closed
1 task done
tschaub opened this issue Jan 25, 2023 · 0 comments · Fixed by #6049
Closed
1 task done

The --root option is lost on configuration updates and restarts #5985

tschaub opened this issue Jan 25, 2023 · 0 comments · Fixed by #6049
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@tschaub
Copy link

tschaub commented Jan 25, 2023

What version of astro are you using?

[email protected]

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

If you use the --root option to work with source files in an alternate location, the dev server doesn't remember this option on configuration changes and restarts.

To reproduce the issue, see the example below or do this:

  • start with a new "Empty" Astro project
  • create a site directory
  • move src and astro.config.mjs into site
  • add the --root ./site option to the astro scripts in package.json
  • restart the dev server to see everything working
  • make a change to one of the configuration files (e.g. tsconfig.json), see the dev server restart and forget the --root option

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ewfvvj?file=package.json,astro.config.mjs,tsconfig.json,README.md&on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@matthewp matthewp added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Jan 26, 2023
natemoo-re added a commit that referenced this issue Feb 9, 2023
* fix(#5985): preserve `--root` CLI flag on restart

* fix: resolve --root relative to automatic root

* chore: revert container changes

* fix: pass flags.root to restart container

---------

Co-authored-by: Nate Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants