Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silly-panthers-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/package": patch
---

fix: improve warning when encountering import.meta.env
4 changes: 2 additions & 2 deletions packages/package/src/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export function _create_validator(options) {

if (uses_import_meta) {
warnings.push(
'Avoid usage of `import.meta.env` in your code. It requires a bundler to work. ' +
'Consider using packages like `esm-env` instead which provide cross-bundler-compatible environment variables.'
'Avoid usage of `import.meta.env` in your code. It only works in apps bundled with Vite. ' +
'Consider using packages like `esm-env` instead which works with all bundlers or without bundling.'
);
}

Expand Down