Skip to content

Commit

Permalink
fix(component-testing): make sure vite html is published on npm (#15379)
Browse files Browse the repository at this point in the history
* fix: make sure html is published

* simplify and rollback changes

* remove rsp in the dependencies

* update yarn lock
  • Loading branch information
Barthélémy Ledoux authored Mar 10, 2021
1 parent 59dbed9 commit 325a7ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
13 changes: 8 additions & 5 deletions npm/vite-dev-server/index-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@
let importsToLoad = [() => import(specPath).catch(e => {
// if the import failed, it might be because of dependencies
// so we try a quick refresh just in case it is
const expectedMessage = `Failed to fetch dynamically imported module: ${location.origin + specPath}`
// since vite does not work with IE we can use URLSearchParams without polyfill
var searchParams = new URLSearchParams(window.location.search);
if (e.message === expectedMessage && !searchParams.has("refresh")) {
searchParams.set('refresh', '1')

// Since vite does not work with IE we can use URLSearchParams without polyfill
const searchParams = new URLSearchParams(window.location.search);
const r = searchParams.has("refresh") ? parseInt(searchParams.get("refresh"), 10) + 1 : 0
// limit the number of refresh (dependency discovery depths)
// to 2 instead of 1 for React-DOM
if (r < 2) {
searchParams.set('refresh', r)
window.location.search = searchParams
} else {
throw new Error(`
Expand Down
12 changes: 0 additions & 12 deletions npm/vite-dev-server/index.html

This file was deleted.

3 changes: 2 additions & 1 deletion npm/vite-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"vite": ">= 2"
},
"files": [
"dist"
"dist",
"index-template.html"
],
"license": "MIT",
"repository": {
Expand Down

4 comments on commit 325a7ec

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 325a7ec Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/circle-develop-325a7ec56e9dd91e25f39184407751daf3b9a371/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 325a7ec Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/appveyor-develop-325a7ec56e9dd91e25f39184407751daf3b9a371/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 325a7ec Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/appveyor-develop-325a7ec56e9dd91e25f39184407751daf3b9a371/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 325a7ec Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/6.7.0/circle-develop-325a7ec56e9dd91e25f39184407751daf3b9a371/cypress.tgz

Please sign in to comment.