Skip to content

Instantly share code, notes, and snippets.

@magnusdahlstrand
Created September 6, 2013 18:14
Show Gist options
  • Save magnusdahlstrand/6467705 to your computer and use it in GitHub Desktop.
Save magnusdahlstrand/6467705 to your computer and use it in GitHub Desktop.
Example of how r.js can break css src url declarations by removing quotemarks
r.js -o cssIn=flat.css out=flat_result.css
r.js -o cssIn=import.css out=import_result.css
/* same content as import.css, except for its import statement, and this comment */
@font-face {
font-family: 'Font Name';
src: url('Font-Name.eot');
src: url('Font-Name.eot?#iefix') format('embedded-opentype'),
url('Font-Name.woff') format('woff'),
url('Font-Name.ttf') format('truetype'),
url('Font-Name.svg#Font Name') format('svg');
}
@font-face {
font-family: 'Font Name';
src: url('Font-Name.eot');
src: url('Font-Name.eot?#iefix') format('embedded-opentype'),
url('Font-Name.woff') format('woff'),
url('Font-Name.ttf') format('truetype'),
url('Font-Name.svg#Font Name') format('svg');
}
@import url('flat.css');
@font-face {
font-family: 'Font Name';
src: url('Font-Name.eot');
src: url('Font-Name.eot?#iefix') format('embedded-opentype'),
url('Font-Name.woff') format('woff'),
url('Font-Name.ttf') format('truetype'),
url('Font-Name.svg#Font Name') format('svg');
}
@font-face {
font-family: 'Font Name';
src: url(Font-Name.eot);
src: url(Font-Name.eot?#iefix) format('embedded-opentype'),
url(Font-Name.woff) format('woff'),
url(Font-Name.ttf) format('truetype'),
url(Font-Name.svg#Font Name) format('svg');
}
@font-face {
font-family: 'Font Name';
src: url('Font-Name.eot');
src: url('Font-Name.eot?#iefix') format('embedded-opentype'),
url('Font-Name.woff') format('woff'),
url('Font-Name.ttf') format('truetype'),
url('Font-Name.svg#Font Name') format('svg');
}
@magnusdahlstrand
Copy link
Author

The issue here is that r.js removes the quote marks surrounding the path for the imported file, but not paths in the "top level" file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment