File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -124,12 +124,12 @@ as ES modules and `.cjs` files are always treated as CommonJS.
124124### Package scope and file extensions  
125125
126126A folder containing a ` package.json `  file, and all subfolders below that folder
127- down  until the next folder containing another ` package.json ` , is considered  a
128- _ package scope_ . The ` "type" `  field defines how ` .js `  files should be treated 
129- within a particular  ` package.json `  file’s  package scope. Every package in a
127+ until the next folder containing another ` package.json ` , are  a
128+ _ package scope_ . The ` "type" `  field defines how to treat  ` .js `  files
129+ within the  package scope. Every package in a
130130project’s ` node_modules `  folder contains its own ` package.json `  file, so each
131- project’s dependencies have their own package scopes. A  ` package.json `  lacking a 
132- ` "type" `  field is treated as if it contained  ` "type":  "commonjs" ` .
131+ project’s dependencies have their own package scopes. If a  ` package.json `  file 
132+ does not have a  ` "type" `  field, the default  ` "type" `  is  ` "commonjs" ` .
133133
134134The package scope applies not only to initial entry points (` node my-app.js ` )
135135but also to files referenced by ` import `  statements and ` import() `  expressions.
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments