Skip to content

Commit 074d13f

Browse files
committed
support <template condense>
sets the compiler `whitespace` option to "condense" vuejs/vue#9208 (comment)
1 parent 2d02e1c commit 074d13f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

transform.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ module.exports = function (vueSource, vueFilename, extraPlugins) {
101101
needMap: false
102102
});
103103

104+
const whitespace = template && template.attrs && template.attrs.condense ? 'condense' : 'preserve';
105+
104106
const {code, tips, errors} = template ? cutils.compileTemplate({
105107
source: template.content,
106108
compiler,
107109
isFunctional: template && template.attrs.functional,
108110
isProduction: true, // just disables prettifying render functions as of 2.2.0
109-
compilerOptions: {outputSourceRange: true}
111+
compilerOptions: {outputSourceRange: true, whitespace}
110112
}) : {};
111113

112114
let renderFunctionDeclr, staticRenderArrayExpr;

0 commit comments

Comments
 (0)