From e2594dffe42776cf8c53725d79525fb0b8b08d68 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 26 May 2020 15:42:02 -0400 Subject: [PATCH] fix: lazy require @vue/compiler-dom so it respects NODE_ENV --- src/node/build/buildPluginHtml.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/node/build/buildPluginHtml.ts b/src/node/build/buildPluginHtml.ts index a6b8b1eeeabc5c..89e7a936f0805b 100644 --- a/src/node/build/buildPluginHtml.ts +++ b/src/node/build/buildPluginHtml.ts @@ -4,8 +4,8 @@ import fs from 'fs-extra' import { isExternalUrl, cleanUrl, isStaticAsset } from '../utils/pathUtils' import { resolveAsset } from './buildPluginAsset' import { - parse, - transform, + parse as Parse, + transform as Transform, NodeTransform, NodeTypes, TextNode, @@ -130,9 +130,11 @@ const compileHtml = async ( inlineLimit: number, resolver: InternalResolver ) => { + const { parse, transform } = require('@vue/compiler-dom') + // @vue/compiler-core doesn't like lowercase doctypes html = html.replace(/