Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async minify() {
try {
const parseTree = this.parseTree.clone();
const result = await cssnano.process(
parseTree,
{ from: undefined, map: { annotation: false } }, // Tell postcss to not remove the sourceMappingURL comment
{
preset: [
'default',
{
svgo: false,
discardComments: {
remove(comment) {
return !/@preserve|@license|[@#]\s*sourceURL|[#@]\s*sourceMappingURL|^!/.test(
comment
);
}
}
}
]
async minify() {
try {
const result = await cssnano.process(
this.parseTree,
{ from: undefined, map: { annotation: false } }, // Tell postcss to not remove the sourceMappingURL comment
{
preset: [
'default',
{
svgo: false,
discardComments: {
remove(comment) {
return !/@preserve|@license|[@#]\s*sourceURL|[#@]\s*sourceMappingURL|^!/.test(
comment
);
}
}
}
]
* http://cssnano.co/optimisations/ for more details.
*
* For example you can turn off z-index rebasing by setting `zindex: false`
* in your config, or you can use `safe: true` which will turn off unsafe
* optimisations.
*/
const opts = {
};
/*
* Compress the CSS asynchronously and log it to the console.
*/
cssnano.process(css, opts).then(result => {
console.log(result.css);
});
.then(function (result) {
save(file, result.css)
console.log('salad - ' + file)
cssnano(loadDist(file))
.then(function (result) {
save('vuep.min.css', result.css)
console.log('cssnao - vuep.min.css')
})
}).catch(function (err) {
console.log(err)
.then(function (result) {
save(file, result.css)
console.log('salad - ' + file)
isProd &&
cssnano(loadLib(file)).then(function (result) {
saveMin(file, result.css)
console.log('cssnao - ' + file)
})
})
.catch(function (err) {
module.exports = function Normalize(cssObj) {
return CSSNano.process(
cssObj.toString(),
{
preset: 'advanced',
from: 'undefined'
},
{ //CSS Nano Config -> http://cssnano.co/optimisations/
autoprefixer: false,
calc: true,
colormin: true,
convertValues: true,
core: true,
discardDuplicates: true,
discardEmpty: true,
discardOverridden: true,
discardUnused: false,
filterOptimiser: true,
.then((purified) => cssnano(purified, { autoprefixer: { add: true } }))
.then(({ css }) => fs.outputFileAsync(`build/public/bundle.css`, css))
cssnanoPromise = cssnanoPromise.then(() => {
let minify = cssnano.process( baseSource, nanoOptions).then(output => {
compilation.assets[asset] = new ConcatSource(output.css)
});
if (match) {
const rtlMinify = cssnano.process(rtlSource, nanoOptions).then(output => {
compilation.assets[filename] = new ConcatSource(output.css)
rtlFiles.push(filename)
});
minify = Promise.all([minify, rtlMinify]);
}
return minify;
})
}