-
-
Notifications
You must be signed in to change notification settings - Fork 124
test: add tests for prebundleSvelteLibraries #491
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
Conversation
| expect(optimizedPaths).toContain( | ||
| 'e2e-test-dep-svelte-nested > e2e-test-dep-svelte-simple > e2e-test-dep-cjs-only' | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing as we don't do deep optimization when prebundleSvelteLibraries yet.
| optimizeDeps: { | ||
| // TODO this must be excluded because nested has an scss dep that prebundle can't handle! | ||
| // figure out how to exclude it automatically or at least tell the user about it in a more friendly way | ||
| exclude: ['e2e-test-dep-svelte-nested'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a bug in Vite. Currently it externalizes .scss/.css etc files when prebundling, but looks like it's failing when it's a package that exports a .scss file. Replacing this as e2e-test-dep-scss-only should have the same effect
| // TODO without this, it fails for module.exports in the browser. | ||
| // shouldn't prebundling take care of it? | ||
| 'e2e-test-dep-svelte-hybrid > e2e-test-dep-cjs-only' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this will be fixed by #482. The requests shows that it's not using the prebundled files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a snippet of it
import Hybrid from '/@fs/Users/bjorn/Work/oss/vite-plugin-svelte/node_modules/.pnpm/file+packages+e2e-tests+_test_dependencies+svelte-hybrid/node_modules/e2e-test-dep-svelte-hybrid/index.js';
import Simple from '/@fs/Users/bjorn/Work/oss/vite-plugin-svelte/node_modules/.pnpm/file+packages+e2e-tests+_test_dependencies+svelte-simple/node_modules/e2e-test-dep-svelte-simple/index.js';
import { Message as Nested } from '/@fs/Users/bjorn/Work/oss/vite-plugin-svelte/node_modules/.pnpm/file+packages+e2e-tests+_test_dependencies+svelte-nested/node_modules/e2e-test-dep-svelte-nested/src/index.js';
import { setSomeContext } from '/node_modules/.vite/deps/e2e-test-dep-svelte-api-only.js?v=89f48f1a';
import { getContext } from '/node_modules/.vite/deps/svelte.js?v=89f48f1a';
const file = "src/App.svelte";|
Tests merged into #482 |
cherry-picked the tests from #478 on main to compare the results