-
Notifications
You must be signed in to change notification settings - Fork 23
Fixing dynamic imports #288
Fixing dynamic imports #288
Conversation
@@ -1 +0,0 @@ | |||
import 'cypress-vue-unit-test/support' |
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 delete looks suspicious
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.
It was breaking the e2e tests. I was also suspicious. @bahmutov what's this line doing for us? I don't see a support file.
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.
we need to load suport
file which creates a placeholder element in the iframe, which we do in
we point at that support file here https://github.com/bahmutov/cypress-vue-unit-test/pull/247/files#diff-73ffe0d8ebfaf5bdc6b0546e41f576c0R11 using an alias to avoid coding ../../support
https://github.com/bahmutov/cypress-vue-unit-test/pull/247/files#diff-6d4bb79610683d9749d2cbb62e708d88
If this breaks, land this PR after #287 and we can check out the merged result to see if it works correctly
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.
Seemingly no issues after merging that PR... will continue merging and then validate again
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.
good to land
Support images loaded with url-loader
🎉 This PR is included in version 1.12.0-cypress-mount-mode.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Adds support for the following use cases
<router-link>
() => import('./myCoolCode')
Context
Cypress does not have the ability to serve static assets. This becomes problematic when dealing with chunks like
[name]-[hash].js
.Vue CLI, by default, splits out vendors into their own chunk, so the
splitChunks
plugin is enabled by default. While we can turn Split Chunks off, we still have to contend with raw Dynamic Imports.Because Cypress cannot serve static assets, we would like a single chunk to be generated by webpack. This solution must also work for any dynamic imports that will be executed.
Solution
LimitChunkCountPlugin
to include the valuemaxChunks: 1
. Documentation found here