Skip to content

Add ability to set transformToRequire option under vue in webpack… #316

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

Merged
merged 4 commits into from
Aug 17, 2016
Merged

Add ability to set transformToRequire option under vue in webpack… #316

merged 4 commits into from
Aug 17, 2016

Conversation

fnlctrl
Copy link
Member

@fnlctrl fnlctrl commented Aug 17, 2016

Add ability to set transformToRequire option under vue in webpack config,
This provides the missing feature from html-loader to specify which tag-attribute combination to be transformed to require().

transformToRequire Defaults to {img: 'src'}.

Example usage: (in webpack.config.js)

vue: {
  transformToRequire: {
    foo: 'bar'
  }
}

will transform <foo bar="..."/> to <foo bar="require(...)"/>

… config,

This provides the missing feature from html-loader to specify which tag-attribute combination to be transformed to `require()`.

`transformToRequire` Defaults to {img: 'src'}.

Example usage: (in webpack.config.js)
```javascript
vue: {
  transformToRequire: {
    foo: 'bar'
  }
}
``
will transform ``<foo bar="..."/>`` to ``<foo bar="require(...)"/>``
@yyx990803
Copy link
Member

Maybe also a good idea to make it support an array of attrs:

vue: {
  transformToRequire: {
    foo: ['bar', 'baz']
  }
}

@fnlctrl
Copy link
Member Author

fnlctrl commented Aug 17, 2016

Yeah, implementing it now.

@fnlctrl
Copy link
Member Author

fnlctrl commented Aug 17, 2016

Done.

@yyx990803 yyx990803 merged commit 3b1558a into vuejs:next Aug 17, 2016
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

Successfully merging this pull request may close these issues.

2 participants