Fix standalone tag when data-type is not set. (#11624)

This commit is contained in:
Dan Fabulich 2020-05-27 09:19:12 -07:00 committed by GitHub
parent 242d9e0b20
commit 05804b166c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@ function buildBabelOptions(script, filename) {
*/
function run(transformFn, script) {
const scriptEl = document.createElement("script");
if (typeof script.type !== "undefined") {
if (script.type) {
scriptEl.setAttribute("type", script.type);
}
scriptEl.text = transformCode(transformFn, script);