mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-25 08:38:57 -06:00
13 lines
437 B
JavaScript
13 lines
437 B
JavaScript
const path = require('path')
|
|
|
|
module.exports = function getAssetPath (options, filePath, placeAtRootIfRelative) {
|
|
// if the user is using a relative URL, place js & css at dist root to ensure
|
|
// relative paths work properly
|
|
if (placeAtRootIfRelative && options.baseUrl.charAt(0) !== '/') {
|
|
return filePath.replace(/^\w+\//, '')
|
|
}
|
|
return options.assetsDir
|
|
? path.posix.join(options.assetsDir, filePath)
|
|
: filePath
|
|
}
|