Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add fallback to default TemplateCompileOptions #310

Merged
merged 2 commits into from
Dec 11, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,28 @@ If a string is provided, it will be an assumed path to a TypeScript configuratio
}
```

#### templateCompiler

You can provide [TemplateCompileOptions](https://github.com/vuejs/component-compiler-utils#compiletemplatetemplatecompileoptions-templatecompileresults) in `templateCompiler` section like this:

```json
{
"jest": {
"globals": {
"vue-jest": {
"templateCompiler": {
"transpileOptions": {
"transforms": {
"dangerousTaggedTemplateString": true
}
}
}
}
}
}
}
```

### Supported template languages

- **pug** (`lang="pug"`)
Expand Down
4 changes: 1 addition & 3 deletions lib/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ function processTemplate(template, filename, config) {
compilerOptions: {
optimize: false,
...userTemplateCompilerOptions.compilerOptions
},
transformAssetUrls: { ...userTemplateCompilerOptions.transformAssetUrls },
transpileOptions: { ...userTemplateCompilerOptions.transpileOptions }
}
})

logResultErrors(result)
Expand Down