Skip to content

Commit

Permalink
refactor: use ECMA modules in overlay (#3607)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Aug 10, 2021
1 parent 9313454 commit 1307332
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client-src/overlay.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)
// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).

const ansiHTML = require("ansi-html");
const { encode } = require("html-entities");
import ansiHTML from "ansi-html";
import { encode } from "html-entities";

const colors = {
reset: ["transparent", "transparent"],
Expand Down Expand Up @@ -138,6 +138,7 @@ function show(messages, type) {
const errorMessage = message.message || messages[0];
const text = ansiHTML(encode(errorMessage));
const messageTextNode = document.createElement("div");

messageTextNode.innerHTML = text;

entryElement.appendChild(typeElement);
Expand Down

0 comments on commit 1307332

Please sign in to comment.