File tree 5 files changed +11
-18
lines changed
5 files changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,7 @@ added: REPLACEME
134
134
135
135
> Stability: 1 - Experimental
136
136
137
- Enables the ` "development" ` [ conditional export] [ ] in package resolution,
138
- while also setting ` process.env.NODE_ENV ` to ` "development" ` .
137
+ Enables the ` "development" ` [ conditional export] [ ] in package resolution.
139
138
140
139
### ` --disable-proto=mode `
141
140
<!-- YAML
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ File name of the V8 CPU profile generated with
101
101
.Fl -cpu-prof
102
102
.
103
103
.It Fl -dev
104
- Sets the development exports resolution and NODE_ENV environment variable .
104
+ Enables the development mode conditional exports resolution .
105
105
.
106
106
.It Fl -disable-proto Ns = Ns Ar mode
107
107
Disable the `Object.prototype.__proto__` property. If
Original file line number Diff line number Diff line change @@ -174,9 +174,6 @@ function initializeReport() {
174
174
}
175
175
176
176
function setupDebugEnv ( ) {
177
- if ( getOptionValue ( '--dev' ) ) {
178
- process . env . NODE_ENV = 'development' ;
179
- }
180
177
require ( 'internal/util/debuglog' ) . initializeDebugEnv ( process . env . NODE_DEBUG ) ;
181
178
if ( getOptionValue ( '--expose-internals' ) ) {
182
179
require ( 'internal/bootstrap/loaders' ) . NativeModule . exposeInternals ( ) ;
Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ const dev = process.env.NODE_ENV === 'development';
4
4
5
5
export async function resolve ( specifier , context , defaultResolve ) {
6
6
ok ( Array . isArray ( context . conditions ) , 'loader receives conditions array' ) ;
7
- deepStrictEqual ( [ ...context . conditions ] . sort ( ) ,
8
- [ 'import' , 'node' , ...dev ? [ 'development' ] : [ ] ] ) ;
7
+ deepStrictEqual (
8
+ [ ...context . conditions ] . filter ( c => c !== 'development' ) . sort ( ) ,
9
+ [ 'import' , 'node' ]
10
+ ) ;
9
11
return defaultResolve ( specifier , {
10
12
...context ,
11
13
conditions : [ 'custom-condition' , ...context . conditions ] ,
Original file line number Diff line number Diff line change 1
1
import { fileURLToPath } from 'url' ;
2
2
import { createRequire } from 'module' ;
3
- import { strictEqual } from 'assert' ;
3
+ import { strictEqual , AssertionError } from 'assert' ;
4
4
5
5
const require = createRequire ( fileURLToPath ( import . meta. url ) ) ;
6
-
7
- const expectValue =
8
- process . env . NODE_ENV === 'development' ? 'development' : 'production' ;
9
-
10
- strictEqual ( require ( 'pkgexports-dev' ) , expectValue ) ;
6
+ const requireVal = require ( 'pkgexports-dev' ) ;
11
7
12
8
( async ( ) => {
13
- const { default : value } = await import ( 'pkgexports-dev' ) ;
14
- strictEqual ( value , expectValue ) ;
15
-
16
- console . log ( expectValue ) ;
9
+ const { default : importVal } = await import ( 'pkgexports-dev' ) ;
10
+ strictEqual ( requireVal , importVal ) ;
11
+ console . log ( importVal ) ;
17
12
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments