Skip to main content
added 131 characters in body
Source Link
dryniex
  • 3.7k
  • 20
  • 12

The simplest answer is:As Geoff pointed out the following code returns not the module's path but working directory.

import path from 'path'; const __dirname = path.resolve(); 

works with --experimental-modules

The simplest answer is:

import path from 'path'; const __dirname = path.resolve(); 

works with --experimental-modules

As Geoff pointed out the following code returns not the module's path but working directory.

import path from 'path'; const __dirname = path.resolve(); 

works with --experimental-modules

deleted 10 characters in body
Source Link
dryniex
  • 3.7k
  • 20
  • 12

I believe theThe simplest answer is:

import path from 'path'; const __dirname = path.resolve(); 

works with --experimental-modules

I believe the simplest answer is:

import path from 'path'; const __dirname = path.resolve(); 

works with --experimental-modules

The simplest answer is:

import path from 'path'; const __dirname = path.resolve(); 

works with --experimental-modules

Source Link
dryniex
  • 3.7k
  • 20
  • 12

I believe the simplest answer is:

import path from 'path'; const __dirname = path.resolve(); 

works with --experimental-modules