Search code examples
elmelm-reactor

How to set source-directories when running elm-reactor


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

I cannot find module 'MyModule'.


Solution

  • 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.