Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: supporting custom urlToRequire function #61

Open
egoist opened this issue Apr 29, 2019 · 1 comment
Open

feature request: supporting custom urlToRequire function #61

egoist opened this issue Apr 29, 2019 · 1 comment

Comments

@egoist
Copy link

egoist commented Apr 29, 2019

Allow transformAssetUrls to be used like this:

transformAssetUrls: {
  'optimize-img': {
     src: value => `require('!optimize-img-loader!${value}')`
  }
}
<template>
  <optimize-img src="./foo.png" />
</template>

I can create a PR if you think it's useful.

@znck
Copy link
Member

znck commented Apr 29, 2019

This would be a good improvement. PR much appreciated.

I feel it would be better to just transform the path and leave wrapping in require() on the compiler.

transformAssetUrls: {
  'optimize-img': {
     src: value => `'!optimize-img-loader!${value}'` // transform the path.
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants