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

--config must be used with = #19522

Closed
7 tasks done
basickarl opened this issue Feb 26, 2025 · 1 comment
Closed
7 tasks done

--config must be used with = #19522

basickarl opened this issue Feb 26, 2025 · 1 comment
Labels
invalid This doesn't seem right

Comments

@basickarl
Copy link

basickarl commented Feb 26, 2025

Describe the bug

https://vite.dev/config/

It states you can do the following: vite --config my-config.js

This does not work on my machine, I must explicitly use the = symbol: vite --config=my-config.js for this to work

Config (vite.config.ts):

Image

Works:

Image

Does not work:

Image

As you see, it doesn't respect the port number.

Reproduction

https://github.com/basickarl/ts-alias

Steps to reproduce

npm install

for it to work run: npm run dev

for it to not respect the config run: npm run dev-does-not-use-config

You can see in the package.json the differences between the scripts.

System Info

System:
    OS: macOS 14.1.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 2.42 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v22.14.0/bin/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
    pnpm: 10.4.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 133.0.6943.127
    Safari: 17.1

I am also using ZSH as the shell.

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

I think this is caused by npx.
npx --no vite --config vite.config.ts does not work, but npx --no -- vite --config vite.config.ts works. I think the config option is removed by npx.

@sapphi-red sapphi-red added invalid This doesn't seem right and removed pending triage labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants