Skip to content

Commit

Permalink
Fix PostCSS API
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Apr 16, 2018
1 parent fcf5a42 commit 49a26eb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ module.exports = {
const root = postcss.parse(css, { from: example });
root.walk(node => {
if ( node.type === 'rule' ) {
node.selector = postcssSP.process(node.selector);
node.selectorAST = postcssSP.process(node.selector);
} else if ( node.type === 'decl' ) {
node.value = postcssVP(node.value);
node.valueAST = postcssVP(node.value);
}
});
root.toResult();
Expand Down
8 changes: 6 additions & 2 deletions prefixers.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ module.exports = {
name: 'Autoprefixer',
defer: true,
fn: done => {
processor.process(css, { map: false }).then(() => {
processor.process(css, {
from: example, map: false
}).then(() => {
done.resolve();
});
}
Expand Down Expand Up @@ -106,7 +108,9 @@ if ( fs.existsSync(devA) && fs.existsSync(devP) ) {
name: 'Autoprefixer dev',
defer: true,
fn: done => {
devProcessor.process(css, { map: false }).then(() => {
devProcessor.process(css, {
from: example, map: false
}).then(() => {
done.resolve();
});
}
Expand Down
8 changes: 6 additions & 2 deletions preprocessors.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ module.exports = {
name: 'PostCSS',
defer: true,
fn: done => {
processor.process(pcss, { map: false }).then(() => {
processor.process(pcss, {
from: example, map: false
}).then(() => {
done.resolve();
});
}
Expand Down Expand Up @@ -203,7 +205,9 @@ if ( fs.existsSync(devPath) ) {
name: 'PostCSS dev',
defer: true,
fn: done => {
devProcessor.process(pcss, { map: false }).then(() => {
devProcessor.process(pcss, {
from: example, map: false
}).then(() => {
done.resolve();
});
}
Expand Down

0 comments on commit 49a26eb

Please sign in to comment.