Skip to content

Commit 1307332

Browse files
refactor: use ECMA modules in overlay (#3607)
1 parent 9313454 commit 1307332

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

client-src/overlay.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)
22
// They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).
33

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

77
const colors = {
88
reset: ["transparent", "transparent"],
@@ -138,6 +138,7 @@ function show(messages, type) {
138138
const errorMessage = message.message || messages[0];
139139
const text = ansiHTML(encode(errorMessage));
140140
const messageTextNode = document.createElement("div");
141+
141142
messageTextNode.innerHTML = text;
142143

143144
entryElement.appendChild(typeElement);

0 commit comments

Comments
 (0)