0

How do I specify areas for looking up Module names in elm-reactor, current it says

I cannot find module 'MyModule'.

glennsl
  • 28,186
  • 12
  • 57
  • 75
user2167582
  • 5,986
  • 13
  • 64
  • 121

1 Answers1

3

In your elm-package.json file, using the "source-directories" key. I believe the default is [ "." ], so by default it will look in the same directory as the elm-package.json file.

{
    "source-directories": [
        "."
    ]
}

You can change it to [ "src" ] or even add multiple paths, since it's an array.

Sidney
  • 4,495
  • 2
  • 18
  • 30
  • so if im running `elm-make` does it always look for a file locally named `elm-package.json`? – user2167582 Dec 14 '17 at 10:33
  • Correct. Several of the elm commands use the `elm-package.json` for info about project, like installed packages and source directory.. – Sidney Dec 14 '17 at 18:15