Skip to content

Commit

Permalink
feat(npm/webpack-preprocessor): WIP support webpack 5 alongside webpa…
Browse files Browse the repository at this point in the history
…ck 4 (#16493)

* feat: support webpack 5 alongside webpack 5

* revert code
  • Loading branch information
lmiller1990 committed May 13, 2021
1 parent a19009a commit d37fa84
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions npm/webpack-preprocessor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ const preprocessor: WebpackPreprocessor = (options: PreprocessorOptions = {}): F
// when we should watch, we hook into the 'compile' hook so we know when
// to rerun the tests
if (file.shouldWatch) {
debug('watching')

if (compiler.hooks) {
// TODO compile.tap takes "string | Tap"
// so seems we just need to pass plugin.name
Expand All @@ -352,7 +350,9 @@ const preprocessor: WebpackPreprocessor = (options: PreprocessorOptions = {}): F

if (file.shouldWatch) {
// in this case the bundler is webpack.Compiler.Watching
(bundler as webpack.Compiler.Watching).close(cb)
if (bundler && 'close' in bundler) {
bundler.close(cb)
}
}
})

Expand Down Expand Up @@ -380,8 +380,10 @@ preprocessor.__reset = () => {
bundles = {}
}

function cleanseError (err: string) {
return err.replace(/\n\s*at.*/g, '').replace(/From previous event:\n?/g, '')
function cleanseError (err: string | Error) {
let msg = typeof err === 'string' ? err : err.message

return msg.replace(/\n\s*at.*/g, '').replace(/From previous event:\n?/g, '')
}

export = preprocessor

4 comments on commit d37fa84

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d37fa84 May 13, 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.3.1/circle-develop-d37fa84d327091b5bb552d7670e6bcb7fd2d3199/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d37fa84 May 13, 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.3.1/appveyor-develop-d37fa84d327091b5bb552d7670e6bcb7fd2d3199/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d37fa84 May 13, 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.3.1/appveyor-develop-d37fa84d327091b5bb552d7670e6bcb7fd2d3199/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on d37fa84 May 13, 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.3.1/circle-develop-d37fa84d327091b5bb552d7670e6bcb7fd2d3199/cypress.tgz

Please sign in to comment.