Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import util from 'util';
import fs from 'fs-extra';
import chalk from 'ansi-colors';
import sass from 'sass';
import Console from '../utils/console.js';
import countTime from '../utils/count-time.js';
import findProjectRoot from '../utils/find-project-root.js';
import lookup from '../utils/recursive-file-lookup.js';
import say from '../utils/say.js';
import { formatTimePassed, formatSize } from '../utils/asset-reporter.js';
const compileScssAsync = util.promisify(sass.render);
export default function(buildConfig={
applicationName: null,
buildCache: {
vendorAppends: '', vendorPrepends: '', applicationAppends: '', applicationPrepends: ''
},
cliArguments: {},
ENV: {},
indexHTMLInjections: {},
projectRoot: null,
}) {
return new Promise(async (resolve, reject) => {
Console.log(chalk.yellow('BUILDING:'), 'application.css...');
const projectRoot = buildConfig.projectRoot || await findProjectRoot();
const ENV = buildConfig.ENV || {};
import util from 'util';
import fs from 'fs-extra';
import chalk from 'ansi-colors';
import sass from 'sass';
import Console from '../utils/console.js';
import countTime from '../utils/count-time.js';
import findProjectRoot from '../utils/find-project-root.js';
import lookup from '../utils/recursive-file-lookup.js';
import say from '../utils/say.js';
import { formatTimePassed, formatSize } from '../utils/asset-reporter.js';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const compileScssAsync = util.promisify(sass.render);
export default function(buildConfig={
applicationName: null,
buildCache: {
vendorAppends: '', vendorPrepends: '', applicationAppends: '', applicationPrepends: ''
},
cliArguments: {},
ENV: {},
indexHTMLInjections: {},
projectRoot: null,
}) {
return new Promise(async (resolve, reject) => {
Console.log(chalk.yellow('BUILDING:'), 'documentation.css...');
const projectRoot = buildConfig.projectRoot || await findProjectRoot();
const ENV = buildConfig.ENV || {};
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style type="text/css">' + sass + '</style>';
},
exports['sass'] = function(text) {
return '<style type="text/css">\n' +
require('sass').render(text) +
'\n</style>';
};
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style type="text/css">' + sass + '</style>';
},
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style type="text/css">' + sass + '</style>';
},
return new Promise((ok, reject) => {
sass.render(options, (error, result) => {
if (error) {
reject(error);
}
else {
ok(result);
}
});
});
}
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style>' + sass + '</style>';
},
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style type="text/css">' + sass + '</style>';
},
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style type="text/css">' + sass + '</style>';
},