Skip to content

Commit

Permalink
Updated loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
richardeschloss committed Dec 2, 2022
1 parent 34b741f commit 0194ea1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/utils/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function resolve (specifier, context, defaultResolve) {
const { parentURL = baseURL } = context
if (regex.test(specifier)) {
return {
shortCircuit: true,
url: new URL(specifier, parentURL).href
}
}
Expand All @@ -51,23 +52,27 @@ export async function load (url, context, defaultLoad) {
if (url.endsWith('vue.runtime.esm.js')) {
const { source } = await defaultLoad(url, { format: 'module' })
return {
shortCircuit: true,
format: 'module',
source: source.toString()
}
} else if (url.endsWith('.vue')) {
const { source } = await defaultLoad(url, { format: 'module' })
return {
shortCircuit: true,
format: 'module',
source: transformVue(source.toString(), url)
}
} else if (url.endsWith('.ts')) {
const { source } = await defaultLoad(url, { format: 'module' })
return {
shortCircuit: true,
format: 'module',
source: source.toString()
}
} else if (url.endsWith('.css')) {
return {
shortCircuit: true,
format: 'module',
source: 'export default {}'
}
Expand Down

0 comments on commit 0194ea1

Please sign in to comment.