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

fix: move config related methods to 'vitest/node' #765

Merged
merged 1 commit into from Feb 16, 2022

Conversation

pd4d10
Copy link
Contributor

@pd4d10 pd4d10 commented Feb 16, 2022

closes #764

@netlify
Copy link

netlify bot commented Feb 16, 2022

✔️ Deploy Preview for vitest-dev ready!

🔨 Explore the source changes: fd9b8fd

🔍 Inspect the deploy log: https://app.netlify.com/sites/vitest-dev/deploys/620caac5b161e70007b3a740

😎 Browse the preview: https://deploy-preview-765--vitest-dev.netlify.app

@sheremet-va
Copy link
Member

I think we have some tests with vitest.config.ts. Can you import defineConfig from vitest/node there instead of vite to be consistent? And to check if it's working properly

@antfu antfu merged commit ce418c5 into vitest-dev:main Feb 16, 2022
@pd4d10
Copy link
Contributor Author

pd4d10 commented Feb 16, 2022

I think we have some tests with vitest.config.ts. Can you import defineConfig from vitest/node there instead of vite to be consistent? And to check if it's working properly

OK. I'll check it later.

@pd4d10 pd4d10 deleted the patch-1 branch February 16, 2022 10:52
@pd4d10
Copy link
Contributor Author

pd4d10 commented Feb 17, 2022

vitest.config.mjs works (which is the way I use it), while .js and .ts don't. Error message:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './node' is not defined by "exports" in /xxx/node_modules/vitest/package.json

The reason seems to be that js/ts config are treated as cjs in vite, while vitest doesn't have an entry point for exporting cjs.

Shall we add a cjs entry? We may need to do some tweaks in the rollup config.

@sheremet-va
Copy link
Member

vitest.config.mjs works (which is the way I use it), while .js and .ts don't. Error message:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './node' is not defined by "exports" in /xxx/node_modules/vitest/package.json

The reason seems to be that js/ts config are treated as cjs in vite, while vitest doesn't have an entry point for exporting cjs.

Shall we add a cjs entry? We may need to do some tweaks in the rollup config.

Somehow I missed your message. After receiving new issues with this i created a PR: #799

chaii3 pushed a commit to chaii3/vitest that referenced this pull request May 13, 2022
* feat(watchOnce): new Function

* chore(watchOnce): improve code

* chore: simplify

Co-authored-by: webfansplz <>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
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

Successfully merging this pull request may close these issues.

defineConfig doesn't work properly
3 participants