Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
target,
sourceMap,
rootContext,
resourcePath,
resourceQuery
} = loaderContext
const rawQuery = resourceQuery.slice(1)
const incomingQuery = qs.parse(rawQuery)
const options = (loaderUtils.getOptions(loaderContext) ||
{}) as VueLoaderOptions
const isServer = target === 'node'
const isProduction = mode === 'production'
const { descriptor, errors } = parse(source, {
filename: resourcePath,
sourceMap
})
if (errors.length) {
errors.forEach(err => {
formatError(err, source, resourcePath)
loaderContext.emitError(err)
})
return ``
}
// if the query has a type field, this is a language block request
// e.g. foo.vue?type=template&id=xxxxx
// and we will return early
if (incomingQuery.type) {