nucleartide / ember-elm

Write Elm in your Ember app
https://medium.com/@nucleartide/introducing-ember-elm-d47f2af73aff
Other
55 stars 7 forks source link

Bug Fix - Ember serve fails to incorporate changes outside of `includePaths` #49

Open thematthopkins opened 4 years ago

thematthopkins commented 4 years ago

This addresses a regression caused by the 19.1 upgrade.

To Reproduce:

  1. ember serve
  2. open Hello/Label.elm - update text from Send to New Send
  3. open browser to dummy app

Expected

See send button w/ text New Send

Actual

See send button w/ text Send

Making any update to Main/Chat.elm and saving then results in New Send coming through.

Solve

It seems using includePaths made it so that the build output was considered a result of only the files within includePaths, when the nature of elm compilation means the build output needs to take into account changes to files outside of includePaths.

This fix opts instead to use our own mainDirs option to whitelist a set of paths for Elm compilation inclusion, so that ember/broccoli still considers all elm files to be incorporated into the output asset.

I've tested this out in our larger ember/elm project, and it works well there too.

To get this fix working in your project, make sure you remove includePaths from your ember-cli-build.js