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

CDN参数希望能运用在css文件中的url上 #14

Open
StArRy5211 opened this issue Jun 28, 2018 · 3 comments
Open

CDN参数希望能运用在css文件中的url上 #14

StArRy5211 opened this issue Jun 28, 2018 · 3 comments

Comments

@StArRy5211
Copy link

Load方法中设置了CDN,但是不会在css文件中url引用上生效

@JacksonTian
Copy link
Owner

CSS 里如果是相对地址的话 应该没问题的吧

@StArRy5211
Copy link
Author

StArRy5211 commented Jul 4, 2018

其实我这边是想通过CDN这个参数实现eggjs静态资源服务的prefix功能,在css中如果url使用绝对路径CDN参数不会应用,改为相对地址的话 loader编译的时候是根据to来设置的相对路径,而真正引用的时候是根据css文件url来做的相对路径两边并不匹配。现在我的解决方案是建立prefix的文件目录,如果原来目标是app/public 由于prefix的设置 我现在必需建立app/prefix/public目录这样来做。其实我有一点不太明白,编译的时候对会这些引用资源做合并,但是为什么引用的时候还是走的url

@JacksonTian
Copy link
Owner

有没有个例子具体说明下?

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