Skip to content

Commit

Permalink
Support CompileRequest.silent of embedded protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Jan 10, 2024
1 parent ad6f671 commit 0dfa68a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ export {render, renderSync} from './src/legacy';

export const info = `sass-embedded\t${pkg.version}`;

export const Logger = {
silent: {warn() {}, debug() {}},
};
export {Logger} from './src/logger';

// Legacy JS API

Expand Down
2 changes: 2 additions & 0 deletions lib/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Dispatcher, DispatcherHandlers} from './dispatcher';
import {Exception} from './exception';
import {FunctionRegistry} from './function-registry';
import {ImporterRegistry} from './importer-registry';
import {Logger} from './logger';
import {MessageTransformer} from './message-transformer';
import {PacketTransformer} from './packet-transformer';
import {SyncEmbeddedCompiler} from './sync-compiler';
Expand Down Expand Up @@ -148,6 +149,7 @@ function newCompileRequest(
quietDeps: !!options?.quietDeps,
verbose: !!options?.verbose,
charset: !!(options?.charset ?? true),
silent: options?.logger === Logger.silent,
});

switch (options?.style ?? 'expanded') {
Expand Down
7 changes: 7 additions & 0 deletions lib/src/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2024 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

export const Logger = {
silent: {warn() {}, debug() {}},
};

0 comments on commit 0dfa68a

Please sign in to comment.