Open alxtz opened 6 years ago
@alxtz would it be possible you create a PR for this feature request?
@alxtz as a workaround you can switch to vue-jest
. I can confirm that it works with multiple-file components and lang=html
@vire this PR from the other project might have the secret sauce for adding support for Vue's default configuration (html templates): https://github.com/eddyerburgh/vue-jest/pull/29/files
I'm submitting a ... (check one with "x")
Current behavior If a vue single file template contains
lang="html"
It would actually fail to run itI've found where it went wrong, it's in
index.js
, the part to detect the lang type for the template. Currently it supportspug
orresultHTML
, and throwing other types away.Expected behavior The
lang="html"
should be detected and use it.Minimal reproduction of the problem with instructions
<template lang="html">
vue-server-renderer
'srenderToString
util to parse it.What is the motivation / use case for changing the behavior?
https://github.com/vuejs/vue-loader/blob/master/docs/en/options.md#loaders
Since the
html-loader
itself actually exists, and it's used byvue-loader
default to processlang="html"
And
vue-cli
add thelang="html"
by default, I think it would be great to add differentlang
in a config file. Please tell us about your environment:npm: 5.5.1 other dependencies: jest jest-vue-preprocessor babel-jest jsdom vue-server-renderer
jest-vue-preprocessor: 1.1.X "jest-vue-preprocessor": "^1.3.1"
Node version : [ OSX | Linux | Windows ] node: 6.9.1 OSX: 10.13.1
Platform: [ OSX | Linux | Windows ] OSX: 10.13.1
I would love to discuss about what could be a great way to add this support for lang="html", and other langs used in vue-loader.