mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
'minify-css.js package.js Implemented Log.error() and Log.warn()'
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
@@ -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}`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user