Skip to content

Commit

Permalink
fix: ensure root el mounting exists, remove userland html webpack plu…
Browse files Browse the repository at this point in the history
…gin (#15870)

* fix: ensure root el exists

* fix: remove userland webpack plugins

* chore: bump html webpack plugin version

* fix: remove preload plugin

* chore: remove dep

* fix: revert code

* chore: revert

* chore: revert

* fix: null check for user webpack
  • Loading branch information
lmiller1990 authored Apr 9, 2021
1 parent d0dcf22 commit 726120d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion npm/webpack-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"debug": "4.3.2",
"html-webpack-plugin": "^4.0.0",
"lazy-compile-webpack-plugin": "0.1.11",
"semver": "^7.3.4",
"webpack-merge": "^5.4.0"
Expand All @@ -25,7 +26,6 @@
"webpack-dev-server": "^3.11.0"
},
"peerDependencies": {
"html-webpack-plugin": "^4.0.0",
"webpack": ">=4",
"webpack-dev-server": "^3.0.0"
},
Expand Down
20 changes: 20 additions & 0 deletions npm/webpack-dev-server/src/makeWebpackConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import CypressCTOptionsPlugin, { CypressCTOptionsPluginOptions } from './plugin'

const debug = debugFn('cypress:webpack-dev-server:makeWebpackConfig')
const WEBPACK_MAJOR_VERSION = Number(webpack.version.split('.')[0])
const removeList = ['HtmlWebpackPlugin', 'PreloadPlugin']

export interface UserWebpackDevServerOptions {
/**
Expand Down Expand Up @@ -68,6 +69,25 @@ export async function makeWebpackConfig (userWebpackConfig: webpack.Configuratio
],
}

// certain plugins conflict with HtmlWebpackPlugin and cause
// problems for some setups.
// most of these are application optimizations that are not relevant in a
// testing environment.
// remove those plugins to ensure a smooth configuration experience.
// https://github.com/cypress-io/cypress/issues/15865
if (userWebpackConfig?.plugins) {
userWebpackConfig.plugins = userWebpackConfig.plugins.filter((plugin) => {
if (removeList.includes(plugin.constructor.name)) {
/* eslint-disable no-console */
console.warn(`[@cypress/webpack-dev-server]: removing ${plugin.constructor.name} from configuration.`)

return false
}

return true
})
}

const mergedConfig = merge<webpack.Configuration>(
userWebpackConfig,
defaultWebpackConfig,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19133,7 +19133,7 @@ html-webpack-plugin@4.0.0-beta.5:
tapable "^1.1.0"
util.promisify "1.0.0"

html-webpack-plugin@^4.5.0:
html-webpack-plugin@^4.0.0, html-webpack-plugin@^4.5.0:
version "4.5.2"
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz#76fc83fa1a0f12dd5f7da0404a54e2699666bc12"
integrity sha512-q5oYdzjKUIPQVjOosjgvCHQOv9Ett9CYYHlgvJeXG0qQvdSojnBq4vAdQBwn1+yGveAwHCoe/rMR86ozX3+c2A==
Expand Down

4 comments on commit 726120d

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 726120d Apr 9, 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/7.0.2/circle-develop-726120da183cb6d89c83181761d21f09844a9fc2/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 726120d Apr 9, 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/7.0.2/appveyor-develop-726120da183cb6d89c83181761d21f09844a9fc2/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 726120d Apr 9, 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/7.0.2/appveyor-develop-726120da183cb6d89c83181761d21f09844a9fc2/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 726120d Apr 9, 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/7.0.2/circle-develop-726120da183cb6d89c83181761d21f09844a9fc2/cypress.tgz

Please sign in to comment.