Comparing version 1.2.2 to 1.2.3
17
index.js
@@ -9,3 +9,2 @@ const fs = require('fs'); | ||
const less = require('less'); | ||
const csso = require('csso'); | ||
@@ -129,3 +128,3 @@ require('log-timestamp'); | ||
async function generateCSS() { | ||
const { css } = await postcss([ | ||
const plugins = [ | ||
require('postcss-css-variables')({ preserve: false }), | ||
@@ -135,11 +134,15 @@ require('autoprefixer'), | ||
require('postcss-preset-env') | ||
]).process(await getFileContent(), { from: false }); | ||
]; | ||
const toCSS = await transpile(css); | ||
const transpiled = await transpile(await getFileContent()); | ||
const minified = (minify && !watch) ? csso.minify(toCSS.css).css : toCSS.css; | ||
if (minify && !watch) { | ||
plugins.push(require('postcss-csso')); | ||
} | ||
const { css } = await postcss(plugins).process(transpiled.css, { from: false }); | ||
return { | ||
css: addSourceMapURL(minified), | ||
map: toCSS.map, | ||
css: addSourceMapURL(css), | ||
map: transpiled.map, | ||
}; | ||
@@ -146,0 +149,0 @@ }; |
{ | ||
"name": "cessie", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Transpile your CSS bundle to support CSS variables, calc, and future CSS for non supported browsers.", | ||
@@ -24,3 +24,2 @@ "main": "index.js", | ||
"autoprefixer": "^9.5.1", | ||
"csso": "^3.5.1", | ||
"file-extension": "^4.0.5", | ||
@@ -35,4 +34,5 @@ "less": "^3.9.0", | ||
"postcss-css-variables": "^0.12.0", | ||
"postcss-csso": "^3.0.0", | ||
"postcss-preset-env": "^6.6.0" | ||
} | ||
} |
15787
152
+ Addedpostcss-csso@^3.0.0
+ Addedcss-tree@1.0.0-alpha25(transitive)
+ Addedcsso@3.3.1(transitive)
+ Addedmdn-data@1.2.0(transitive)
+ Addedpostcss-csso@3.0.0(transitive)
- Removedcsso@^3.5.1
- Removedcss-tree@1.0.0-alpha.29(transitive)
- Removedcsso@3.5.1(transitive)
- Removedmdn-data@1.1.4(transitive)