Skip to content

Commit 4c88431

Browse files
fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups (#14470)
* fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups * fix (albeit with annoying warnings) * bundle with conditions to silence noise * production is probably better --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 parent 10a7729 commit 4c88431

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.changeset/gentle-bulldogs-heal.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups

packages/svelte/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"acorn-typescript": "^1.4.13",
143143
"aria-query": "^5.3.1",
144144
"axobject-query": "^4.1.0",
145-
"esm-env": "^1.2.0",
145+
"esm-env": "^1.2.1",
146146
"esrap": "^1.2.3",
147147
"is-reference": "^3.0.3",
148148
"locate-character": "^3.0.0",

packages/svelte/tests/runtime-browser/test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ async function run_test(
7979
__CONFIG__: path.resolve(test_dir, '_config.js'),
8080
'assert.js': assert_file
8181
},
82+
conditions: ['browser', 'production'],
8283
plugins: [
8384
{
8485
name: 'testing-runtime-browser',
@@ -131,6 +132,7 @@ async function run_test(
131132
__MAIN_DOT_SVELTE__: path.resolve(test_dir, 'main.svelte'),
132133
__CONFIG__: path.resolve(test_dir, '_config.js')
133134
},
135+
conditions: ['browser', 'production'],
134136
plugins: [
135137
{
136138
name: 'testing-runtime-browser-ssr',
@@ -191,9 +193,11 @@ async function run_test(
191193

192194
try {
193195
const page = await browser.newPage();
194-
page.on('console', (type) => {
196+
page.on('console', (message) => {
197+
let method = message.type();
198+
if (method === 'warning') method = 'warn';
195199
// @ts-ignore
196-
console[type.type()](type.text());
200+
console[method](message.text());
197201
});
198202

199203
if (build_result_ssr) {

pnpm-lock.yaml

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)