From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/vue-loader/lib/select.js | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 node_modules/vue-loader/lib/select.js (limited to 'node_modules/vue-loader/lib/select.js') diff --git a/node_modules/vue-loader/lib/select.js b/node_modules/vue-loader/lib/select.js new file mode 100644 index 00000000..2546c9ce --- /dev/null +++ b/node_modules/vue-loader/lib/select.js @@ -0,0 +1,57 @@ +module.exports = function selectBlock ( + descriptor, + loaderContext, + query, + appendExtension +) { + // template + if (query.type === `template`) { + if (appendExtension) { + loaderContext.resourcePath += '.' + (descriptor.template.lang || 'html') + } + loaderContext.callback( + null, + descriptor.template.content, + descriptor.template.map + ) + return + } + + // script + if (query.type === `script`) { + if (appendExtension) { + loaderContext.resourcePath += '.' + (descriptor.script.lang || 'js') + } + loaderContext.callback( + null, + descriptor.script.content, + descriptor.script.map + ) + return + } + + // styles + if (query.type === `style` && query.index != null) { + const style = descriptor.styles[query.index] + if (appendExtension) { + loaderContext.resourcePath += '.' + (style.lang || 'css') + } + loaderContext.callback( + null, + style.content, + style.map + ) + return + } + + // custom + if (query.type === 'custom' && query.index != null) { + const block = descriptor.customBlocks[query.index] + loaderContext.callback( + null, + block.content, + block.map + ) + return + } +} -- cgit v1.2.3