0

I have the following folder structure

public
source
  client
    config
      webpack.common.js

inside the weback.common.js I want to reference the public folder

path.resolve(__dirname, '../', '../', '../', 'public')

it works but it's very annoying and long, is there is a better way to reference this folder ?

Taste of Leaving
  • 304
  • 2
  • 20
  • `path.resolve(__dirname, '../../../public')` – Konrad Dec 20 '22 at 19:37
  • 1
    Does this answer your question? [Determine project root from a running node.js application](https://stackoverflow.com/questions/10265798/determine-project-root-from-a-running-node-js-application) – Konrad Dec 20 '22 at 19:38

0 Answers0