text: (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{232:function(t,e,s){"use strict";s.r(e);var r=s(0),a=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._m(1),t._m(2),t._m(3),t._m(4),t._m(5),s("ul",[t._m(6),s("li",[t._m(7),t._m(8),s("p",[t._v("详情查阅 "),s("a",{attrs:{href:"https://github.com/vuejs/vue-docs-zh-cn/blob/master/vue-template-compiler/README.md#%E9%80%89%E9%A1%B9",target:"_blank",rel:"noopener noreferrer"}},[t._v("vue-template-compiler"),s("OutboundLink"),t._v(" 选项参考")],1),t._v(".")])])]),t._m(9),s("ul",[t._m(10),s("li",[t._m(11),s("p",[t._v("为渲染函数的生成码配置从 ES2015+ 到 ES5 的转译选项。这里的"),s("a",{attrs:{href:"https://github.com/vuejs/vue-template-es2015-compiler",target:"_blank",rel:"noopener noreferrer"}},[t._v("转译器"),s("OutboundLink")],1),t._v("是一份 "),s("a",{attrs:{href:"https://github.com/Rich-Harris/buble",target:"_blank",rel:"noopener noreferrer"}},[t._v("Buble"),s("OutboundLink")],1),t._v(" 的 fork，因此你可以在"),s("a",{attrs:{href:"https://buble.surge.sh/guide/#using-the-javascript-api",target:"_blank",rel:"noopener noreferrer"}},[t._v("这里"),s("OutboundLink")],1),t._v("查阅可用的选项。")]),t._m(12)])]),t._m(13),t._m(14),t._m(15),s("ul",[t._m(16),t._m(17),s("li",[t._m(18),s("p",[t._v("是否使用 webpack 的"),s("a",{attrs:{href:"https://webpack.js.org/concepts/hot-module-replacement/",target:"_blank",rel:"noopener noreferrer"}},[t._v("模块热替换"),s("OutboundLink")],1),t._v("在浏览器中应用变更而"),s("strong",[t._v("不重载整个页面")]),t._v("。\n用这个选项 (值设为 "),s("code",[t._v("false")]),t._v(") 在开发环境下关闭热重载特性。")])])]),t._m(19),t._m(20),s("p",[t._v("强制指定为生产环境，即禁止 loader 注入只在开发环境有效的代码 (例如 hot-reload 相关的代码)。")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"选项参考"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#选项参考","aria-hidden":"true"}},[this._v("#")]),this._v(" 选项参考")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"transformasseturls"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transformasseturls","aria-hidden":"true"}},[this._v("#")]),this._v(" transformAssetUrls")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("类型："),s("code",[t._v("{ [tag: string]: string | Array<string> }")])])]),s("li",[s("p",[t._v("默认值：")]),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n  video"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{attrs:{class:"token string"}},[t._v("'src'")]),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{attrs:{class:"token string"}},[t._v("'poster'")]),s("span",{attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n  source"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token string"}},[t._v("'src'")]),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n  img"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token string"}},[t._v("'src'")]),s("span",{attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n  image"),s("span",{attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{attrs:{class:"token string"}},[t._v("'xlink:href'")]),t._v("\n"),s("span",{attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("在模板编译过程中，编译器可以将某些特性转换为 "),s("code",[t._v("require")]),t._v(" 调用，例如 "),s("code",[t._v("src")]),t._v(" 中的 URL。因此这些目标资源可以被 webpack 处理。例如 "),s("code",[t._v('<img src="./foo.png">')]),t._v(" 会找到你文件系统中的 "),s("code",[t._v("./foo.png")]),t._v(" 并将其作为一个依赖包含在你的包里。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"compiler"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#compiler","aria-hidden":"true"}},[this._v("#")]),this._v(" compiler")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("类型："),e("code",[this._v("VueTemplateCompiler")])])]),e("li",[e("p",[this._v("默认值："),e("code",[this._v("require('vue-template-compiler')")])]),e("p",[this._v("覆写用来编译单文件组件中 "),e("code",[this._v("<template>")]),this._v(" 块的默认编译器。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"compileroptions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#compileroptions","aria-hidden":"true"}},[this._v("#")]),this._v(" compilerOptions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("类型："),e("code",[this._v("Object")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("默认值："),e("code",[this._v("{}")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("模板编译器的选项。当使用默认的 "),e("code",[this._v("vue-template-compiler")]),this._v(" 的时候，你可以使用这个选项来添加自定义编译器指令、模块或通过 "),e("code",[this._v("{ preserveWhitespace: false }")]),this._v(" 放弃模板标签之间的空格。")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"transpileoptions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transpileoptions","aria-hidden":"true"}},[this._v("#")]),this._v(" transpileOptions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("类型："),e("code",[this._v("Object")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("默认值："),e("code",[this._v("{}")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("模板渲染函数编译支持一个特殊的变换 "),e("code",[this._v("stripWith")]),this._v(" (默认启用)，它会删除生成的渲染函数中的 "),e("code",[this._v("with")]),this._v(" 用法，使它们兼容严格模式。")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"optimizessr"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#optimizessr","aria-hidden":"true"}},[this._v("#")]),this._v(" optimizeSSR")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("类型："),s("code",[t._v("boolean")])])]),s("li",[s("p",[t._v("默认值：当 webpack 配置中包含 "),s("code",[t._v("target: 'node'")]),t._v(" 且 "),s("code",[t._v("vue-template-compiler")]),t._v(" 版本号大于等于 2.4.0 时为 "),s("code",[t._v("true")]),t._v("。")]),s("p",[t._v("开启 Vue 2.4 服务端渲染的编译优化之后，渲染函数将会把返回的 vdom 树的一部分编译为字符串，以提升服务端渲染的性能。在一些情况下，你可能想要明确地将其关掉，因为该渲染函数只能用于服务端渲染，而不能用于客户端渲染或测试环境。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"hotreload"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#hotreload","aria-hidden":"true"}},[this._v("#")]),this._v(" hotReload")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("类型："),e("code",[this._v("boolean")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("默认值：在开发环境下是 "),e("code",[this._v("true")]),this._v("，在生产环境下或 webpack 配置中有 "),e("code",[this._v("target: 'node'")]),this._v(" 的时候是 "),e("code",[this._v("false")]),this._v("。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("允许的值："),e("code",[this._v("false")]),this._v(" ("),e("code",[this._v("true")]),this._v(" 会强制热重载，即便是生产环境或 "),e("code",[this._v("target: 'node'")]),this._v(" 时)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"productionmode"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#productionmode","aria-hidden":"true"}},[this._v("#")]),this._v(" productionMode")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("类型："),e("code",[this._v("boolean")])]),e("li",[this._v("默认值："),e("code",[this._v("process.env.NODE_ENV === 'production'")])])])}],!1,null,null,null);e.default=a.exports}}]);