guybedford / require-css

A RequireJS CSS loader plugin to allow CSS requires and optimization
MIT License
983 stars 364 forks source link

How to skip url path normalization #187

Open krampstudio opened 9 years ago

krampstudio commented 9 years ago

How can I skip url path normalization inside my css while optimizing ? I'm building a single module, the goal is to publish it along with resources but the paths doesn't match. The path were I produce the module isn't the target path. If can only skip this it would be fine. Right now, I've commented the while loop in the normalizeCss function... (see https://github.com/oat-sa/require-css/blob/master/normalize.js#L122)

FYI, my r.js conf :

{
            baseUrl : '../js',
            mainConfigFile : '',
            findNestedDependencies : true,
            wrapShim: true,
            inlineCss : true,
            name: "moduleName",
            out: "module.min.js"
        }
guybedford commented 9 years ago

Try setting the siteRoot config to make the paths match up. If you really want to avoid the normalization, perhaps use // style URLs in the stylesheet.

espretto commented 8 years ago

greetings! url-normalization is giving me a hard time in my multi-page setup with spritesheets. could you make it an opt-out/-in feature? i currently use return source; in the normalize#L122 module.