Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Added lang="livescript" support #112

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add the ability to specify other postcss options (#99)
* Add the ability to specify other postcss options

* Fixed usage of postcss
  • Loading branch information
Darius Tall authored and yyx990803 committed Jun 24, 2016
commit 2f63b254cfeac235d9d183d341cdc1bf7708ded0
16 changes: 12 additions & 4 deletions lib/style-rewriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ module.exports = function (id, css, scoped) {
if (val) {
return Promise.resolve(val)
} else {
var plugins = options.postcss
? options.postcss.slice()
: []
var plugins = []
var opts = {}

if (options.postcss instanceof Array) {
plugins = options.postcss.slice()
} else if (options.postcss instanceof Object) {
plugins = options.postcss.plugins || []
opts = options.postcss.options
}

// scoped css rewrite
if (scoped) {
plugins.push(addId)
Expand All @@ -66,7 +73,7 @@ module.exports = function (id, css, scoped) {
}
currentId = id
return postcss(plugins)
.process(css)
.process(css, opts)
.then(function (res) {
var val = {
source: res.css,
Expand All @@ -77,3 +84,4 @@ module.exports = function (id, css, scoped) {
})
}
}

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy