Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(mako): add debug notice for local builds #1743

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/mako/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'fs';
import os from 'os';
import path from 'path';
import chalk from 'chalk';
import { omit } from 'lodash';
import resolve from 'resolve';
import { type Options } from 'sass';
Expand Down Expand Up @@ -42,6 +43,13 @@ function blockStdout() {
export async function build(params: BuildParams) {
blockStdout();

// if mako is running in local build, print a notice
if (!__dirname.includes('node_modules')) {
console.log(
chalk.red('NOTICE: Mako is running in DEBUG mode with local build...'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that using chalk.red for the debug notice is appropriate for your use case, as it might be interpreted as an error message. Consider using a different color if the notice is informational.

);
}

params.config.plugins = params.config.plugins || [];
params.config.resolve = params.config.resolve || {};

Expand Down
Loading