Skip to content

huixisheng/postcss-assets-cdn

Repository files navigation

postcss-assets-cdn Build Status Coverage percentage

postcss-assets-cdn

This PostCSS plugin will transform this:

.foo {
  background: url('/assets/alipay.png')
}

To this:

.foo {
  background: url(https://huixisheng.github.com/Fg0s0GU_xDPd2rOgAYYikJDTiEhL)
}

Installation

npm i -D postcss-assets-cdn

Usage

postcss([ require('postcss-assets-cdn') ])

Config

baseUrl: configDeploy.get('ossConfig.baseUrl'),
cache: '.cache.json',
ossConfig: {
    accessKeyId: configDeploy.get('ossConfig.accessKeyId'),
    accessKeySecret: configDeploy.get('ossConfig.accessKeySecret'),
    bucket: configDeploy.get('ossConfig.bucket'),
    endpoint: configDeploy.get('ossConfig.endpoint'),
    https: true,
    delDistImg: false,
    region: configDeploy.get('ossConfig.region')
}

install x-config-deploy Setting to configure sensitive information

About

图片上传CDN的postcss插件

Resources

License

Stars

Watchers

Forks

Packages

No packages published