PostCSS Baseurl PostCSS plugin for add baseurl to absolute url assets. .foo { background: url('/image.png')} .foo { background: url('/mobile/image.png')} Usage postcss([ require('postcss-baseurl')({ base: '/mobile' })]) See PostCSS docs for examples for your environment.