-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
css loader chokes on valid CSS #43
Comments
yeah. We propably need to implement our own parser, which just grabs |
Ok...? That would need to allow all chars in RFC3986, and the CSS2 spec 4.3.4 and import like these. So that's implemented by these regexes: Test-data:
var uriNoQ = /url\((?<path>([a-zA-Z\.\/\-_0-9:~?\[\]@!$&*+,;=]|\\')*)\)/,
uriSingleQ = /url\('(?<path>([a-zA-Z\.\/\-_0-9:~?\[\]@!$&\(\)*+,;="]|\\')*)'\)/,
uriDoubleQ = /url\("?(?<path>([a-zA-Z\.\/\-_0-9:~?\[\]@!$&\(\)*+,;=']|\\")*)"?\)/
var importUriNoQ = /@import url\(?(?<path>([a-zA-Z\.\/\-_0-9:~?\[\]@!$&*+,;=])*)\)?/,
importUriSingleQ = /@import (url\()?'(?<path>([a-zA-Z\.\/\-_0-9:~?\[\]@!$&\(\)*+,;="]|\\')*)'\)?/,
importUriDoubleQ = /@import (url\()?"?(?<path>([a-zA-Z\.\/\-_0-9:~?\[\]@!$&\(\)*+,;=']|\\")*)"?\)?/ since JS doesn't have recursion in their regexps. You'll have to find the index = 1 match group from them, since I don't think JS supports named regex either. The first case disallows urls with This works with my sample file. Can you throw such a loader together now, please, so I can publish my site? I would really owe you one. |
Do you all have thoughts on using this css parser? It only breaks out the code to an AST which you could then query for url from ast trees that are of type import.
|
Seems like that parser has a bug in the parsing of URLs with |
I would like to make it simpler and just allow everything except the end mark:
Here is a simple module which combines statemachine with regex for parsing. i. e. the html-loader uses it to parse the html: https://github.com/webpack/fastparse cc @jhnns |
👍 |
Any word on this? |
For me this has meant I can't use webpack right now. I did some looking into how to write a regex parser, but there's just so much undocumented structure that I don't recognise, so I gave up. I haven't had any other contact with anyone from webpack. |
@haf I just got around this by switching the filename to .scss and using the sass-loader |
Ok, I had problems with that loader as well; other problems, like race-conditions breaking 25 minute builds (latest problem) and problems finding a stable version in general, unfortunately. If you look inside that repo for issues started by me, you'll see how interested they are in helping out. |
Thx @sokra. I'm totally busy right now (because I'm relocating) and haven't found the time to investigate this 😞 |
Apply default singleton to IE6-8 as well
https://gist.github.com/haf/a632962b86409b8c51e3
As you can see, there's no line 414.
The text was updated successfully, but these errors were encountered: