Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/mercury/src/cli/internal/file-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const ensureDirectoryExistsAndItsClear = (dirPath: string) => {
fs.rmSync(dirPath, { recursive: true });
}

fs.mkdirSync(dirPath);
fs.mkdirSync(dirPath, { recursive: true });
};

export function* walkSync(dir: string): Generator<FileMetadata> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from "node:fs";
import path from "node:path";
import * as sass from "sass";

import {
BASE_BUNDLE_WITH_BACK_SLASH,
Expand All @@ -19,11 +20,16 @@ import {
import { BundleMetadata, FileMetadata } from "./types.js";
import {
getBundleNameWithoutSpecialChars,
replacePlaceholdersInBundle,
transpileBundle
replacePlaceholdersInBundle
} from "./utils.js";
import { printBundleWasTranspiled } from "./print-utils.js";

const transpileBundle = (filePath: string, globant: boolean) =>
sass.compile(filePath, {
loadPaths: [globant ? "src/config/globant" : "src/config/default"],
style: "compressed"
}).css;

const CSS_CREATED_DIRS = new Set();
const JS_CREATED_DIRS = new Set();
const BUNDLES: BundleMetadata[] = [];
Expand Down
7 changes: 0 additions & 7 deletions packages/mercury/src/cli/internal/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import crypto from "node:crypto";
import { styleText } from "node:util";
import * as sass from "sass";

import {
FONT_FACE_PATH_PLACEHOLDER,
Expand Down Expand Up @@ -29,12 +28,6 @@ export const getFileSize = (fileContent: string) => {
return fileLengthInGB.toFixed(3) + "GB";
};

export const transpileBundle = (filePath: string, globant: boolean) =>
sass.compile(filePath, {
loadPaths: [globant ? "src/config/globant" : "src/config/default"],
style: "compressed"
}).css;

export const getHash = (fileContent: string) =>
crypto.createHash("md5").update(fileContent).digest("hex").substring(16);

Expand Down
Loading