Skip to content

Commit

Permalink
fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups (#14470
Browse files Browse the repository at this point in the history
)

* 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 <[email protected]>
  • Loading branch information
benmccann and Rich-Harris authored Nov 30, 2024
1 parent 10a7729 commit 4c88431
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-bulldogs-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups
2 changes: 1 addition & 1 deletion packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"acorn-typescript": "^1.4.13",
"aria-query": "^5.3.1",
"axobject-query": "^4.1.0",
"esm-env": "^1.2.0",
"esm-env": "^1.2.1",
"esrap": "^1.2.3",
"is-reference": "^3.0.3",
"locate-character": "^3.0.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/svelte/tests/runtime-browser/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ async function run_test(
__CONFIG__: path.resolve(test_dir, '_config.js'),
'assert.js': assert_file
},
conditions: ['browser', 'production'],
plugins: [
{
name: 'testing-runtime-browser',
Expand Down Expand Up @@ -131,6 +132,7 @@ async function run_test(
__MAIN_DOT_SVELTE__: path.resolve(test_dir, 'main.svelte'),
__CONFIG__: path.resolve(test_dir, '_config.js')
},
conditions: ['browser', 'production'],
plugins: [
{
name: 'testing-runtime-browser-ssr',
Expand Down Expand Up @@ -191,9 +193,11 @@ async function run_test(

try {
const page = await browser.newPage();
page.on('console', (type) => {
page.on('console', (message) => {
let method = message.type();
if (method === 'warning') method = 'warn';
// @ts-ignore
console[type.type()](type.text());
console[method](message.text());
});

if (build_result_ssr) {
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c88431

Please sign in to comment.