mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
Add autoprefixing to CSS pipeline (#867)
Add [autoprefixer](https://github.com/postcss/autoprefixer) as a final build step in the CSS pipeline.
This commit is contained in:
parent
d42ecb943f
commit
d3417b3bf2
7 changed files with 112 additions and 7 deletions
|
@ -6,6 +6,8 @@
|
|||
*/
|
||||
|
||||
const cssnano = require('cssnano');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const postcss = require('postcss');
|
||||
const path = require('path');
|
||||
const escapeStringRegexp = require('escape-string-regexp');
|
||||
|
||||
|
@ -54,9 +56,18 @@ function minifyCss(cssContent) {
|
|||
.then(result => result.css);
|
||||
}
|
||||
|
||||
function autoPrefixCss(cssContent) {
|
||||
return postcss([autoprefixer])
|
||||
.process(cssContent, {
|
||||
from: undefined,
|
||||
})
|
||||
.then(result => result.css);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getSubDir,
|
||||
getLanguage,
|
||||
isSeparateCss,
|
||||
minifyCss,
|
||||
autoPrefixCss,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue