-
Notifications
You must be signed in to change notification settings - Fork 671
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 base url #412
Comments
There is cssPrefix, which I just added to example.build.js, but it is more fore relative URLs for a single CSS optimization (discussed in #350) but it is for relative URL resolution. In general, I assumed that css @import inlining was just for relative URLs, and I wanted to encourage that local referencing, just like dependency strings that are URLs, like '/some/config.js' are not really supported in the optimizer. So it is unclear if this is actually desirable. |
CSS paths are not like moduleIDs - they are always urls. And there is a So the issue is that there needs to be a concept of 'base URL' within cas I have this working in RequireCSS, but am very much open to alternatives. I On Wednesday, March 27, 2013, James Burke wrote:
|
The alternative here is to assume each module will know its own "backtrack distance" from the base path. And then to always use backtracking to access dependencies from the global root. Perhaps this is a simpler way forward anyway. |
Just to update here, in the current version of require-css and require-less, I am defining a "siteRoot" configuration on the base level r.js config, which is the location of the site root on the server, relative to the outDir or outFile paths, defaulting to ".". This way, CSS paths can all be made absolute during the build step. This may be useful for the CSS optimization steps to share this variable as well. |
When inline imports from css files, there is no way to know what is meant by an import of the form:
The optimizer currently leaves out these optimizations. If there was an option to specify the "cssBase", then it would be possible to inline these imports as well. I would then be able to share this configuration option within RequireCSS to provide the same functionality.
Let me know if that makes sense, or if there is an option for this already at all? I could also potentially look at doing a pull request if it helps.
The text was updated successfully, but these errors were encountered: