Skip to content

Commit 9acf2b7

Browse files
authored
Merge pull request #84 from mitchcapper/old_webkit_support_newer_node_hack_pr
fix: Add ENV option to allow legacy ssl for newer node versions and our older webpack
2 parents 8382e60 + 26f6873 commit 9acf2b7

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

automation/ts-node.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

automation/ts-node.env.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
TS_NODE_PROJECT: './automation/tsconfig.json',
3+
TS_NODE_FILES: true
4+
};
5+
6+
// WebPack 4 and some other details require old OpenSSL providers when
7+
// running in Node v17+:
8+
if (process.version.match(/^v(\d+)/)[1] > 16) {
9+
module.exports['NODE_OPTIONS'] = '--openssl-legacy-provider';
10+
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"scripts": {
1212
"prebuild": "rimraf dist/*",
1313
"build": "run-script-os",
14-
"build:default": "env-cmd -f ./automation/ts-node.env node --max_old_space_size=4096 node_modules/.bin/webpack --config ./automation/webpack.prod.ts",
15-
"build:windows": "env-cmd -f ./automation/ts-node.env node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config ./automation/webpack.prod.ts",
14+
"build:default": "env-cmd -f ./automation/ts-node.env.js node --max_old_space_size=4096 node_modules/.bin/webpack --config ./automation/webpack.prod.ts",
15+
"build:windows": "env-cmd -f ./automation/ts-node.env.js node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config ./automation/webpack.prod.ts",
1616
"bundle-stats": "npm-run-all bundle-stats:build bundle-stats:show",
1717
"bundle-stats:build": "run-script-os",
1818
"bundle-stats:build:default": "npm run build:default -- --no-devtool --profile --json | tail -n +14 > stats.json",
@@ -22,11 +22,11 @@
2222
"server:start": "cross-env OCLIF_TS_NODE=0 node .httptoolkit-server/httptoolkit-server/bin/run start",
2323
"start": "npm-run-all --parallel --print-label start:server start:web",
2424
"start:server": "npm-run-all server:setup server:start",
25-
"start:web": "env-cmd -f ./automation/ts-node.env webpack-dev-server --config ./automation/webpack.dev.ts",
25+
"start:web": "env-cmd -f ./automation/ts-node.env.js webpack-dev-server --config ./automation/webpack.dev.ts",
2626
"start:prod": "npm-run-all build start:prod:webserver",
2727
"start:prod:webserver": "static-server ./dist -o",
2828
"test": "npm-run-all test:unit test:integration",
29-
"test:unit": "env-cmd -f ./automation/ts-node.env karma start ./test/unit/karma.conf.js",
29+
"test:unit": "env-cmd -f ./automation/ts-node.env.js karma start ./test/unit/karma.conf.js",
3030
"test:unit:dev": "npm run test:unit -- --single-run=false --auto-watch",
3131
"test:unit:debug": "npm run test:unit -- --single-run=false --browsers Chrome",
3232
"test:integration": "npm-run-all server:setup build test:integration:run",

0 commit comments

Comments
 (0)