How to use the postcss-url/src/lib/paths.normalize function in postcss-url

To help you get started, we’ve selected a few postcss-url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mockingbot / ibot / scripts / rollup-options.js View on Github external
url: (...args) => { // TODO: HACK: postcss-url will return asset-url relative to process.cwd(), so calc the relative asset-url again
                // console.log('HACK:', args)
                const remappedUrl = postcssUrlCopy(...args)
                // console.log('HACK:', { remappedUrl, hackedUrl: remappedUrl && normalize(relative(outputRoot, remappedUrl)) })
                return remappedUrl && normalize(relative(outputRoot, remappedUrl))
              },
            })
github pagarme / artis / config / postcssUrlRebase.js View on Github external
module.exports = function postcssUrlRewrite (asset, dir) {
  const rebasedUrl = normalize(
    path.relative(dir.to, asset.absolutePath)
  )

  return `./${rebasedUrl}${asset.search}${asset.hash}`
}
github pagarme / react-scripts-former-kit-dashboard / config / postCSSLoaderOptions.js View on Github external
function postcssUrlRebase(asset, dir) {
  const rebasedUrl = normalize(path.relative(dir.to, asset.absolutePath))
  return `./${rebasedUrl}${asset.search}${asset.hash}`
}

postcss-url

PostCSS plugin to rebase or inline on url().

MIT
Latest version published 4 years ago

Package Health Score

74 / 100
Full package analysis