Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Enable htmlMinifier.conservativeCollapse by default #117

Merged
merged 4 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default {
caseSensitive: true,
customAttrSurround: [[/@/, new RegExp('')], [/:/, new RegExp('')]],
collapseWhitespace: true,
conservativeCollapse: true,
removeComments: true
},

Expand Down
2 changes: 1 addition & 1 deletion src/vueTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function processTemplate (source, id, content, options, nodes, modules) {
debug(`Process template: ${id}`)

const extras = { modules, id, lang: source.attrs.lang }
const code = deIndent(source.code)
const code = deIndent(source.code).trim()
const template = await (
options.disableCssModuleStaticReplacement !== true
? templateProcessor(code, extras, options)
Expand Down
2 changes: 1 addition & 1 deletion test/expects/basic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var evens = [2,4,6,8];
var odds = evens.map(v => v + 1);
var basic = { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1><input type=\"text\">",
var basic = { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1> <input type=\"text\">",
data() {
return odds
}
Expand Down
4 changes: 2 additions & 2 deletions test/expects/imports.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var evens = [2,4,6,8];
var odds = evens.map(v => v + 1);
var Basic = { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1><input type=\"text\">",
var Basic = { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1> <input type=\"text\">",
data() {
return odds
}
};

var imports = { template: "<main><basic></basic></main>",
var imports = { template: "<main> <basic></basic> </main>",
components: {
Basic
}
Expand Down
2 changes: 1 addition & 1 deletion test/expects/slot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var TableComponent = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('table',[_c('tr',[_c('td',[_vm._t("default")],2)])])},staticRenderFns: [],};

var slot = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('table-component',[_vm._v("Hello! World")])},staticRenderFns: [],
var slot = {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('table-component',[_vm._v(" Hello! World ")])},staticRenderFns: [],
components: { TableComponent },
};

Expand Down
2 changes: 1 addition & 1 deletion test/expects/style.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var evens = [2,4,6,8];
var odds = evens.map(v => v + 1);
var style = { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1><input type=\"text\">",
var style = { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1> <input type=\"text\">",
data() {
return odds
}
Expand Down
2 changes: 1 addition & 1 deletion test/expects/typescript-export-obj.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var app = {
};

var __$app = Object.assign(app, { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1><input type=\"text\">",});
var __$app = Object.assign(app, { template: "<h1 :id=\"id\" @click=\"hi\"> hello</h1> <input type=\"text\">",});
__$app.prototype = app.prototype;

export default __$app;
2 changes: 1 addition & 1 deletion test/expects/typescript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var component = { template: "<h1 :id=\"id\" @click=\"hi\">hello</h1><input type=\"text\">",
var component = { template: "<h1 :id=\"id\" @click=\"hi\"> hello</h1> <input type=\"text\">",
data: function () { return ({
hello: 'world!'
}); },
Expand Down