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

include 时,img的 src 属性通过data 传入时不会触发 url-loader #12

Open
rainke opened this issue Jun 9, 2017 · 1 comment

Comments

@rainke
Copy link

rainke commented Jun 9, 2017

新功能需求:

  <!--index.ejs-->
    <% include('./common.ejs', {src:'~@/assets/img.svg'}) %>
<!--common.ejs-->
<img src="<%= src%>" />

对于这种情况,这个 src 不会被 webpack 的 url-loader 解析。

代码:https://github.com/rainke/art-demo/tree/src src分支

@aui
Copy link
Collaborator

aui commented Jun 10, 2017

Webpack 是基于静态分析进行编译的,这样动态的路径当然得不到解析

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