Skip to content

Commit 6592c42

Browse files
committed
chore: add webpack env var to dev env
1 parent 3dd1107 commit 6592c42

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://github.com/webpack/webpack/issues/14532
2+
NODE_OPTIONS=--openssl-legacy-provider

.github/workflows/test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ jobs:
3333
run: pnpm build
3434

3535
- name: Test
36-
env:
37-
# This can't be added to the package.json script because we also test Node.js v16
38-
# https://github.com/webpack/webpack/issues/14532
39-
NODE_OPTIONS: --openssl-legacy-provider
4036
run: pnpm test
4137

4238
- name: Test Node.js v16
43-
run: pnpm --use-node-version=16.19.0 test
39+
run: pnpm --use-node-version=16.19.0 tsx tests

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shell-emulator=true

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
},
3939
"scripts": {
4040
"build": "pkgroll --target=node16.19.0",
41-
"test": "tsx tests",
42-
"dev": "tsx watch --conditions=development tests",
41+
"test": "tsx --env-file=.env tests",
42+
"dev": "tsx watch --env-file=.env --conditions=development tests",
4343
"lint": "lintroll --cache .",
4444
"type-check": "tsc --noEmit",
4545
"prepack": "pnpm build && clean-pkg-json"

tests/specs/tsconfig.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { createFixture } from 'fs-fixture';
55
import { execa } from 'execa';
66
import { tsconfigJson } from '../utils.js';
77

8+
const require = createRequire(import.meta.url);
9+
810
const webpackCli = path.resolve('node_modules/webpack-cli/bin/cli.js');
911
const esbuildLoader = path.resolve('dist/index.cjs');
1012

@@ -73,7 +75,6 @@ export default testSuite(({ describe }) => {
7375
cwd: fixture.path,
7476
});
7577

76-
const require = createRequire(import.meta.url);
7778
expect(
7879
require(path.join(fixture.path, 'dist/main.js')),
7980
).toStrictEqual([true, false, true]);
@@ -127,7 +128,6 @@ export default testSuite(({ describe }) => {
127128
cwd: fixture.path,
128129
});
129130

130-
const require = createRequire(import.meta.url);
131131
expect(
132132
require(path.join(fixture.path, 'dist/main.js')),
133133
).toStrictEqual([true, false]);
@@ -186,7 +186,6 @@ export default testSuite(({ describe }) => {
186186

187187
expect(stdout).toMatch('does not match its "include" patterns');
188188

189-
const require = createRequire(import.meta.url);
190189
expect(
191190
require(path.join(fixture.path, 'dist/main.js')),
192191
).toStrictEqual([true, true]);

0 commit comments

Comments
 (0)