lepu-test-platform-web/node_modules/vue-loader/lib/template-compiler/url-to-require.js

14 lines
387 B
JavaScript
Raw Normal View History

module.exports = function urlToRequire (url) {
// same logic as in transform-require.js
const firstChar = url.charAt(0)
if (firstChar === '.' || firstChar === '~' || firstChar === '@') {
if (firstChar === '~') {
const secondChar = url.charAt(1)
url = url.slice(secondChar === '/' ? 2 : 1)
}
return `require("${url}")`
} else {
return `"${url}"`
}
}