Skip to content

Commit b71554a

Browse files
committed
fix: Conditionally use legacy ssl for newer node versions and our older webpack
Switch to dynamic ENV file for conditional env vars Closes #76
1 parent 8382e60 commit b71554a

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

automation/ts-node.env

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

automation/ts-node.env.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let env_vars = {
2+
TS_NODE_PROJECT:'./automation/tsconfig.json',
3+
TS_NODE_FILES:true
4+
};
5+
if (process.version.match(/^v(\d+)/)[1]>16)
6+
env_vars['NODE_OPTIONS']='--openssl-legacy-provider';
7+
module.exports = env_vars;

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)