Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elm log lost colours #94

Closed
danmarcab opened this issue Jan 11, 2017 · 8 comments
Closed

Elm log lost colours #94

danmarcab opened this issue Jan 11, 2017 · 8 comments

Comments

@danmarcab
Copy link

Webpack is displaying elm log without the colours, is there a way to remedy this?

@eeue56
Copy link
Contributor

eeue56 commented Jan 14, 2017

Can you provide screenshots?

@danmarcab
Copy link
Author

Sure!

Screenshot of output with webpack
screen shot 2017-01-17 at 13 54 19

Without:
screen shot 2017-01-17 at 13 54 29

@ThomasWeiser
Copy link

elm-make won't output colours when stdout is not a terminal.

Maybe someday Elm tools will take this into account, see elm-lang/elm-make#123

You may hack around this by wrapping elm-make with unbuffer or a similar tool. Some options are discussed here (different context, same problem).

@tgecho
Copy link

tgecho commented Jul 15, 2017

To build on what Thomas said above, I added a tiny shell script with the following

#!/usr/bin/env bash
# Fakes elm-make into printing colors when
# run by elm-webpack-loader
# To install unbuffer on macOS:
# $ brew install expect
unbuffer node_modules/.bin/elm-make $@

...and set pathToMake: './bin/unbuffered-elm-make' in the elm-webpack-loader config.

It's a hack, but it's only a one time thing!

@danmarcab
Copy link
Author

Hi @tgecho, that worked!

Thank you very much!

@eeue56 eeue56 reopened this Jul 15, 2017
fpapado added a commit to fpapado/ephemeral that referenced this issue Aug 16, 2017
@RobertFischer
Copy link

@tgecho -- Thanks for this. I integrated it into https://github.com/BeeWell/cordova-elm-template-jumpstart

@eeue56
Copy link
Contributor

eeue56 commented Oct 29, 2017

@RobertFischer if it's easy to add in a lightweight cross-platform way to elm-webpack-loader, please open a PR. I'm closing this issue for now

@jaredramirez
Copy link

I added to @tgecho's script by running the regular elm executable if unbuffer is not installed:

if hash unbuffer 2>/dev/null; then
    unbuffer node_modules/.bin/elm $@
else
    ./node_modules/.bin/elm $@
fi

With the 0.19 webpack config: pathToElm: './bin/unbufferedElm'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants