madsflensted / elm-brunch

Brunch plugin to compile Elm code
MIT License
74 stars 31 forks source link

brunch plugin build order #35

Closed bigardone closed 6 years ago

bigardone commented 7 years ago

Problem

Hi! I'm experimenting an issue in a project, where I'm using elm-brunch along with babel-brunch. The issue is that elm-babel seems to be building first, and one of the js files is importing the main.js created by elm-brunch, which doesn't exist yet, so the build breaks due to not finding that file. I've tried arranging the npm modules to solve the build order issue, as specified in here https://github.com/brunch/brunch/issues/1377#issuecomment-287840153, but it doesn't solve the problem. What can I do?

Information

shamanime commented 7 years ago

I have the same issue, specially when running 'brunch build --production'.

chazsconi commented 6 years ago

@bigardone @shamanime Yes, I have the same problem too. Reverting to v0.7.0 solves the issue as I believe it was introduced by https://github.com/madsflensted/elm-brunch/pull/30.

Other than #33 nothing else has been changed since then apart from updates to the README.

Perhaps a solution would be to have an option to determine when the compilation is done - in the 0.7.0 way or 0.8.0 way.

For now, I will just use 0.7.0.

jesseshieh commented 6 years ago

I had the same problem. Downgrading to 0.7.0 fixed it for me. Thanks you!

nlfiedler commented 6 years ago

It's been a while, any update on this?

madsflensted commented 6 years ago

If anybody can create PR where the build order is configurable then I will be happy to merge and publish.

chazsconi commented 6 years ago

I'm not really sure if the way that #30 changes the elm compilation to happen with the compile method to the onCompile hook is the right approach. Furthermore, I don't think having some switch to change between using compile or onCompile is appropriate as there should just be one way that works in all scenarios.

I cannot reproduce the problem that #30 tries to fix (which was related to the Brunch cache problems) - perhaps it is fixed in a different way by a later version of Brunch itself.

@stelmakh could you provide steps to reproduce the original problem in #30?

happysalada commented 6 years ago

had a problem where elm.js wasn't compiled at all and there was no warning. Fell on this issue by chance and I'm super glad that reverting to 0.7 fixed it. thanks!

chazsconi commented 6 years ago

@madsflensted In the absence of any reply from @stelmakh in how to reproduce the original problem that PR #30 tried to fix, and also that, as far as I can see, #30 introduced bug #38, can we just revert #30 ?

Otherwise we will be stuck with having to use v0.7.0 forever.

madsflensted commented 6 years ago

I will try to have a look at it.

On Oct 30, 2017 00:13, "chazsconi" notifications@github.com wrote:

@madsflenstedin the absence of any reply from @stelmakh https://github.com/stelmakh in how to reproduce the original problem that PR #30 https://github.com/madsflensted/elm-brunch/pull/30 tried to fix, and also that, as far as I can see, #30 https://github.com/madsflensted/elm-brunch/pull/30 introduced bug #38 https://github.com/madsflensted/elm-brunch/issues/38, can we just revert #30 https://github.com/madsflensted/elm-brunch/pull/30 ?

Otherwise we will be stuck with having to use v0.7.0 forever.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/madsflensted/elm-brunch/issues/35#issuecomment-340273890, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ8r4pp-H_Fj7xyAFXVI1VpUJebVY-vOks5sxKQ2gaJpZM4MjfJM .

madsflensted commented 6 years ago

Reverted PR 30, it is published as 0.10.0. Can you check if this resolves this issue?

happysalada commented 6 years ago

I had a problem with elm not compiling at all, and it's fixed with version 0.10.0, thanks a lot!

chazsconi commented 6 years ago

Fixed for me also in 0.10.0 Thanks @madsflensted