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 'build' command in the template/config/typescript/package.json file may be incorrect. #393

Open
mishengqiang opened this issue Nov 29, 2023 · 7 comments

Comments

@mishengqiang
Copy link

mishengqiang commented Nov 29, 2023

When I execute the npm command npm run build -- --mode test, the "@" placeholder only accepts "test", and the "--mode" is missing.
image

When I modified the build command to "run-p type-check "build-only -- {@}" --" (added -- after build-only), executing the npm command npm run build -- --mode test was successful.
image

@mishengqiang mishengqiang changed the title The 'build' command in the template/config/typescript/package.json file may contain errors. The 'build' command in the template/config/typescript/package.json file may be incorrect. Nov 29, 2023
@cexbrayat
Copy link
Member

Hi @mishengqiang

Did you try to run npm run build-only -- --mode test directly?

But yeah, I think you're right it would be better.
Would you like to open a PR to fix? We would gladly review and merge it.

@mishengqiang
Copy link
Author

mishengqiang commented Nov 30, 2023

The npm run build-only -- --mode test command is correct; it aligns with the description in the Vite official documentation.

Sure, thank you for giving me the opportunity to submit a pull request.

@9mm
Copy link

9mm commented Apr 8, 2025

can somone explain why npm-run-all2 is in package json after a fresh vue-create? what is this even for?

@yanhao98
Copy link

yanhao98 commented Apr 8, 2025

can somone explain why npm-run-all2 is in package json after a fresh vue-create? what is this even for?

This npm-run-all package provides 3 CLI commands.

npm-run-all
run-s
run-p


then. the lint command uses run-s

{
  "name": "vue-project",
    "lint": "run-s lint:*",
  },
}

@9mm
Copy link

9mm commented Apr 8, 2025

@yanhao98 ahhh interesting, thank you!

One last question... what is @tsconfig/node22 for? and jiti? I dont see jiti referenced anywyere, i see node22 seems to be loading the node TS config.

All my old (updated) apps dont have this package, but for last project i decided to do a fresh create-vue. how is this different than previous versions that didnt use it?

@yanhao98
Copy link

yanhao98 commented Apr 10, 2025

@9mm

What is @tsconfig/node22 for?

@tsconfig/node22 is a pre-configured TypeScript setup from the TypeScript team (via @tsconfig npm packages), designed for Node.js 22. It ensures your TypeScript aligns with Node 22’s features, module system, and runtime. You’d use it in tsconfig.json like this:

{
  "extends": "@tsconfig/node22/tsconfig.json"
}
Image

What is jiti?

jiti is a lightweight tool for loading TypeScript and ES Modules at runtime. After pnpm create vue@latest, you can remove jiti and your project might still work fine—it’s just a peer dependency for tools like vite and eslint. Run pnpm why jiti to see how it’s pulled in by those tools.

@9mm
Copy link

9mm commented Apr 10, 2025

awesome, thanks!

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

4 participants