'minify-css.js package.js Implemented Log.error() and Log.warn()'

This commit is contained in:
Joshua Maserow
2023-01-27 12:27:07 +02:00
parent 39916d761a
commit d09becbe17
2 changed files with 6 additions and 3 deletions

View File

@@ -9,7 +9,8 @@ Package.registerBuildPlugin({
name: "minifyStdCSS",
use: [
'minifier-css',
'ecmascript'
'ecmascript',
'logging',
],
npmDependencies: {
"@babel/runtime": "7.18.9",
@@ -25,4 +26,5 @@ Package.registerBuildPlugin({
Package.onUse(function(api) {
api.use('minifier-css@1.5.4');
api.use('isobuild:minifier-plugin@1.0.0');
api.use('logging@1.3.1');
});

View File

@@ -2,6 +2,7 @@ import sourcemap from "source-map";
import { createHash } from "crypto";
import LRU from "lru-cache";
import { loadPostCss, watchAndHashDeps, usePostCss } from './postcss.js';
import { Log } from 'meteor/logging';
const { argv, env:{ DEBUG_CSS } } = process;
const verbose = (DEBUG_CSS!=="false" && DEBUG_CSS!=="0" && (
@@ -116,7 +117,7 @@ class CssToolsMinifier {
const { error, postcssConfig } = await loadPostCss();
if (error) {
if (verbose) console.error('processFilesForBundle loadPostCss error', error);
if (verbose) Log.error('processFilesForBundle loadPostCss error', error);
files[0].error(error);
return;
}
@@ -326,5 +327,5 @@ function warnCb (filename, msg) {
// XXX make this a buildmessage.warning call rather than a random log.
// this API would be like buildmessage.error, but wouldn't cause
// the build to fail.
console.log(`${filename}: warn: ${msg}`);
Log.warn(`${filename}: warn: ${msg}`);
};