|
@@ -88,7 +88,7 @@ function createCodegenContext(
|
|
|
sourceMap = false,
|
|
sourceMap = false,
|
|
|
filename = `template.vue.html`,
|
|
filename = `template.vue.html`,
|
|
|
scopeId = null,
|
|
scopeId = null,
|
|
|
- optimizeBindings = false,
|
|
|
|
|
|
|
+ optimizeImports = false,
|
|
|
runtimeGlobalName = `Vue`,
|
|
runtimeGlobalName = `Vue`,
|
|
|
runtimeModuleName = `vue`,
|
|
runtimeModuleName = `vue`,
|
|
|
ssr = false
|
|
ssr = false
|
|
@@ -100,7 +100,7 @@ function createCodegenContext(
|
|
|
sourceMap,
|
|
sourceMap,
|
|
|
filename,
|
|
filename,
|
|
|
scopeId,
|
|
scopeId,
|
|
|
- optimizeBindings,
|
|
|
|
|
|
|
+ optimizeImports,
|
|
|
runtimeGlobalName,
|
|
runtimeGlobalName,
|
|
|
runtimeModuleName,
|
|
runtimeModuleName,
|
|
|
ssr,
|
|
ssr,
|
|
@@ -355,7 +355,7 @@ function genModulePreamble(
|
|
|
helper,
|
|
helper,
|
|
|
newline,
|
|
newline,
|
|
|
scopeId,
|
|
scopeId,
|
|
|
- optimizeBindings,
|
|
|
|
|
|
|
+ optimizeImports,
|
|
|
runtimeModuleName
|
|
runtimeModuleName
|
|
|
} = context
|
|
} = context
|
|
|
|
|
|
|
@@ -368,7 +368,7 @@ function genModulePreamble(
|
|
|
|
|
|
|
|
// generate import statements for helpers
|
|
// generate import statements for helpers
|
|
|
if (ast.helpers.length) {
|
|
if (ast.helpers.length) {
|
|
|
- if (optimizeBindings) {
|
|
|
|
|
|
|
+ if (optimizeImports) {
|
|
|
// when bundled with webpack with code-split, calling an import binding
|
|
// when bundled with webpack with code-split, calling an import binding
|
|
|
// as a function leads to it being wrapped with `Object(a.b)` or `(0,a.b)`,
|
|
// as a function leads to it being wrapped with `Object(a.b)` or `(0,a.b)`,
|
|
|
// incurring both payload size increase and potential perf overhead.
|
|
// incurring both payload size increase and potential perf overhead.
|