Files
cypress/scripts/run-webpack.js
Lachlan Miller c0ea9bdaa5 fix: use posix path for ts-node loader (#22550)
* fix: distribute files to machines for external contributors. (#22326)

* fix: distribute files to machines for external contributors.

* fix path

* fix

* fix glob

* fix

* fix glob pattern spec->cy.

* fix

* echo things.

* test

* use cd.

* fix component tests.

* test

* test

* fix

* refactor

* test distribut-step

fix error
fix
fix
test
TEST

* Revert "test distribut-step"

This reverts commit 15c36065ca.

* Revert "refactor"

This reverts commit 21a8ad9211.

* reduce flake by increasing viewport height

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>

* fix: add baseUrl to TestConfigOverrides (#22445)

Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>

* handle white space when registering ts-node using --require

* update test project

* move config

Co-authored-by: Kukhyeon Heo <sainthkh@naver.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Ishan Madhusanka <ahtimadhusanka@gmail.com>
2022-06-28 09:00:06 -05:00

33 lines
1.3 KiB
JavaScript

const cp = require('child_process')
const path = require('path')
const semver = require('semver')
const webpackCli = path.join(__dirname, '..', 'node_modules', 'webpack-cli', 'bin', 'cli.js')
// https://github.com/cypress-io/cypress/issues/18914
// Node 17+ ships with OpenSSL 3 by default, so we may need the option
// --openssl-legacy-provider so that webpack@4 can use the legacy MD4 hash
// function. This option doesn't exist on Node <17 or when it is built
// against OpenSSL 1, so we have to detect Node's major version and check
// which version of OpenSSL it was built against before spawning the process.
//
// Can be removed once the webpack version is upgraded to >= 5.61,
// which no longer relies on Node's builtin crypto.hash function.
let NODE_OPTIONS = process.env.NODE_OPTIONS || ''
if (process.versions && semver.satisfies(process.versions.node, '>=17.0.0') && semver.satisfies(process.versions.openssl, '>=3', { includePrerelease: true })) {
NODE_OPTIONS = `${NODE_OPTIONS} --openssl-legacy-provider`
}
function buildCommand () {
const file = process.argv.slice(2).join(' ') ?? ''
let program = `node "${webpackCli}"`
return file ? `${program } "${file}"` : program
}
const program = buildCommand()
cp.execSync(program, { stdio: 'inherit', env: { ...process.env, NODE_OPTIONS } })