Skip to content

Commit

Permalink
feat: pass templateCompiler options
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Freisler committed Sep 28, 2020
1 parent 7592dfb commit 37efa58
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,21 @@ function processTemplate(template, filename, config) {
template.content = loadSrc(template.src, filename)
}

const userTemplateCompilerOptions = vueJestConfig.templateCompiler || {}
const result = compilerUtils.compileTemplate({
source: template.content,
compiler: VueTemplateCompiler,
filename: filename,
compilerOptions: {
optimize: false
},
isFunctional: template.attrs.functional,
preprocessLang: template.lang,
preprocessOptions: vueJestConfig[template.lang]
preprocessOptions: vueJestConfig[template.lang],
...userTemplateCompilerOptions,
compilerOptions: {
optimize: false,
...userTemplateCompilerOptions.compilerOptions
},
transformAssetUrls: { ...userTemplateCompilerOptions.transformAssetUrls },
transpileOptions: { ...userTemplateCompilerOptions.transpileOptions }
})

logResultErrors(result)
Expand Down

0 comments on commit 37efa58

Please sign in to comment.