Retain Elm compiler error colors when running Elm application via webpack-dev-server

I am writing an Elm application with webpack, and although it elm-reactorhas very beautiful error color styles, when webpack displays compiler errors, they are all red and harder to read. Is there a way to tell webpack to keep the colors specified by the elm compiler?

+4
source share
2 answers

I don't know anything about the webpack-dev server, but I know that if you use child_processes.spawn(see nodejs docs ) you can pass stdio: "inherit" option to save the exact result of the child process. I used it with elm-makeand it works.

So, I guess some way to apply this to a webpack-dev server?

0
source

This configuration allows me colors:

var server =
   new WebpackDevServer(compiler, {
      hot: true,
      stats: { colors: true }, //This line enable colors
      contentBase: path.join(__dirname, "../build"),
      headers: { "Access-Control-Allow-Origin": "*" }
  });

server.listen(env.PORT);
0
source

Source: https://habr.com/ru/post/1656278/


All Articles