Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-prefix-url

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-prefix-url

Prefix URLs with CDN

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-73.33%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-prefix-url

PostCSS plugin to prefix your urls

Installation

npm i postcss-prefix-url

or

yarn add postcss-prefix-url

Options

OptionTypeDescription
prefixArray or StringThe strings or string to prefix your url paths with
[useUrl = false]BooleanIf set to TRUE then the url()'s will also be prefixed, otherwise ignores them
[exclude]RegexExclude url paths matching this regex

Examples

Input

body {
  background: cdn('/test.png');
}

.testAbsolute {
  background: cdn(http://absolute.com/test1.png); /* Ignore absolute urls */
}

.withUrl {
  background: url(/testUrl.png);
}

.testExclude {
  background: cdn(/exclude-this/test1.png); /* Exclude this url */
}

Output

body {
  background: url(https://img1.example.com/test.png);
}

.testAbsolute {
  background: url(http://absolute.com/test1.png);
}

.withUrl {
  background: url(https://img1.example.com/testUrl.png);
}

.testExclude {
  background: url(/exclude-this/test1.png);
}

Keywords

FAQs

Package last updated on 04 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc