Commit 0c2da0f5 authored by Jianrong Yu's avatar Jianrong Yu Committed by Evan You

feat: append the file extension to the mapping files in devtools (#1372)

close #1371
parent cd17d05e
module.exports = function selectBlock (descriptor, loaderContext, query) {
// template
if (query.type === `template`) {
loaderContext.resourcePath += '.' + (descriptor.template.lang || 'html')
loaderContext.callback(
null,
descriptor.template.content,
......@@ -11,6 +12,7 @@ module.exports = function selectBlock (descriptor, loaderContext, query) {
// script
if (query.type === `script`) {
loaderContext.resourcePath += '.' + (descriptor.script.lang || 'js')
loaderContext.callback(
null,
descriptor.script.content,
......@@ -22,6 +24,7 @@ module.exports = function selectBlock (descriptor, loaderContext, query) {
// styles
if (query.type === `style` && query.index != null) {
const style = descriptor.styles[query.index]
loaderContext.resourcePath += '.' + (style.lang || 'css')
loaderContext.callback(
null,
style.content,
......
......@@ -179,6 +179,6 @@ test('CSS Modules', async () => {
// custom ident
await testWithIdent(
'[path][name]---[local]---[hash:base64:5]',
/css-modules---red---\w{5}/
/css-modules-vue---red---\w{5}/
)
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment