-
Notifications
You must be signed in to change notification settings - Fork 60
Control imports and url() rewriting in CSS #11
Comments
Perhaps @guybedford could help? Or @Alxandr who introduced #9? Thanks guys. This is the last thing separating me from successful production build here. :D |
You would have to modify the css plugin to allow for more settings I think. |
@smajl can you not make the font URL an absolute URL instead of a relative URL? Then it shouldn't be changed I don't think? |
@guybedford absolute uri's can't really be used. Just imagin installing bootstrap for instance. How should it know where it was installed to? Even your own local css can't nesesarily use absolute paths in the css if you have different hosting (locally when I develop I use |
@Alxandr right. Note that for dynamic imports, assets and source maps, it can actually advisable to still serve jspm_packages in production. |
Yeah, but if I do Not really important to get the css in, but it's fun when this stuff Just Works (TM) ^^ |
I have (temporarily) solved this with help of <!-- build:css(.) styles/main.min.css -->
<link rel="stylesheet" href="jspm_packages/github/smajl/bootstrap@master/dist/css/bootstrap.css" />
<link rel="stylesheet" href="jspm_packages/npm/font-awesome@4.3.0/css/font-awesome.css" />
<!-- inject:build:css --><!-- endinject -->
<link rel="stylesheet" href=".tmp/styles/main.css" />
<!-- endbuild --> Problems will arise, when I would need to import some JS lib which has dependency on CSS with urls - the CSS would get processed by plugin and urls cloberred and bundled. I obviously don't want to include the whole file again (duplicating it just to override paths back to original) so I would need to e.g. utilize CSS specificity to override those urls. |
@smajl btw, what is wrong with the path that's generated? |
@Alxandr Well.. you are right, there is no problem with url like that. In practice, I will need to change the build workflow slightly. Copy all the fonts and images to dist directory while keeping the jspm folder structure, that will work. Unfortunately, no matter where I generate the bundle file, the urls are always the same absolute path as mentioned at the top. Would really like to have that same
|
You're using the It's supposed to be handled by this line: https://github.com/systemjs/plugin-css/blob/master/css-builder.js#L26 |
@Alxandr See my first comment, bottom part, there is my jspm config. Yep, I am using |
Right, I've created #13 - it's an important part of the normalization rules. |
When I make sfx bundle (with separate CSS) I get from this in source files:
to this in bundled CSS:
This obviously doesn't work in production. Can please someone give me an advice, how to change my bundle task, so it keeps the urls intact or at least I can override the root path?
jspm.config.js:
The text was updated successfully, but these errors were encountered: