I use the flag --experimental-modules
when running my node application in order to use ES6 modules.
However when I use this flag the metavariable __dirname
is not available. Is there an alternative way to get the same string that is stored in __dirname
that is compatible with this mode?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…