-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
File won't be packed and no error tip when use absolute path in url() #750
Comments
@NE-SmallTown please create minimum reproducible test repo |
same question |
Please create minimum reproducible test repo |
Sorry for too busy, I will provide the repo this weekend if you don't mind |
@ekulabuhov ping~ clone https://github.com/NE-SmallTown/css-loader-absolute-path-test and run I add If I don't add and there is no console If I add |
I just hit the same problem and could track it down to this line in processCss.js. if (options.url && item.url.replace(/\s/g, '').length && !/^#/.test(item.url) && loaderUtils.isUrlRequest(item.url)) {
// ...
} The check I'm not sure if removing that has any other unintentional effects, but it works for me. |
@evilebottnawi ping~ |
@evilebottnawi Friendly ping~, do you have time to look at this? If no, please give some response because maybe others want to start work on this :) |
@NE-SmallTown i am working on |
@NE-SmallTown Can you provide what url you have and what expected? |
@evilebottnawi Cool, will look at whether it's been fixed in 2.0 and will dig into the bug this weekend. |
@evilebottnawi Hi, friendly ping~ ,There is no branch for '0.x' versions, since the alias option has been removed in 1.0, how should I send a pr to fix it in 0.x? |
@NE-SmallTown no, better use latest version |
Ok, close |
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
If so, the iconfont.eot won't be packed to a module/file to the dist directory and won't be added to the devServer when I request the page.
If I add an option/query such as
root: process.cwd()
oralias: {'/src': '../../../'}
to thecss-loader
, the iconfont.eot will be packed to the dist directory but still won't be added to the devServer when I request the page because the url iniconfont.css
still is'/src/assets/font/iconfont.eot'
rather than'/static/assets/font/iconfont.eot'
. But if I use relative path like '../../../assets/font/iconfont.eot' in theurl(...)
, it will automatically transform the '/src/assets/font/iconfont.eot' -> '/static/assets/font/iconfont.eot'Another question it will not throw an Error like
can't find the module '/src/assets/font/iconfont.eot'(seems like begin with '~/' or '/' will cause no throw) in xxxx
. This is a little bad. If I use relative path and give it a wrong path, it will throw.By the way, seems like this is not about less or less-loader, the problem still exists even I just use css.
If the current behavior is a bug, please provide the steps to reproduce.
See above.
What is the expected behavior?
It will works even I use absolute path.
I have searched on google and webpack/css-loader/postcss issues, and have tried many workaround such as resolve.modules, options.url, options.root, options.alias, all of them can'r resolve this.
Have not tried
postcss-url
orresolve-url-loader
, but I think that's not the key because I wan't to know why this won't work rather than how to make it works.Please mention other relevant information such as your webpack version, Node.js version and Operating System.
MacOs
Node 8.11.3
Webpack 3.12.0
css-loader 0.28.9
Thanks.
The text was updated successfully, but these errors were encountered: