Use environment variable for minifying CSS
This commit is contained in:
parent
78a478592d
commit
08efa719f6
|
@ -3,11 +3,11 @@ import * as util from "../util";
|
||||||
import sass, { Result as SassResult } from "node-sass";
|
import sass, { Result as SassResult } from "node-sass";
|
||||||
import ejs from "ejs";
|
import ejs from "ejs";
|
||||||
|
|
||||||
function renderSass(data: string, minify = false): Promise<SassResult> {
|
function renderSass(data: string): Promise<SassResult> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
sass.render({
|
sass.render({
|
||||||
data: data,
|
data: data,
|
||||||
outputStyle: minify ? "compressed" : "expanded"
|
outputStyle: process.env.MINIFY_CSS ? "compressed" : "expanded"
|
||||||
}, (error, result) => {
|
}, (error, result) => {
|
||||||
if (error) reject(error);
|
if (error) reject(error);
|
||||||
else resolve(result);
|
else resolve(result);
|
||||||
|
|
Loading…
Reference in New Issue