Skip to content

Commit

Permalink
fix(app): Import + rename from quasar #7126
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed May 28, 2020
1 parent 594aeeb commit bdf6d79
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/lib/webpack/loader.transform-quasar-imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ module.exports = content => content.replace(
(_, match) => match.split(',')
.map(identifier => {
const data = identifier.split(' as ')
const name = data[0].trim()
const as = data[1] === void 0
? ''
: ` as ${data[1]}`

return `import ${name}${as} from '${importTransform(name)}';`
if (data[1] !== void 0) {
return `import ${data[1].trim()} from '${importTransform(data[0].trim())}';`
}

const name = data[0].trim()
return `import ${name} from '${importTransform(name)}';`
})
.join('')
)

0 comments on commit bdf6d79

Please sign in to comment.