Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jaywcjlove/compile-less
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.5
Choose a base ref
...
head repository: jaywcjlove/compile-less
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.8.6
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Aug 31, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a12d8b3 View commit details
  2. released v1.8.6

    jaywcjlove committed Aug 31, 2021
    Copy the full SHA
    c77f727 View commit details
Showing with 6 additions and 6 deletions.
  1. +2 −2 package.json
  2. +4 −4 src/compile.ts
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "compile-less-cli",
"version": "1.8.5",
"version": "1.8.6",
"description": "All `.less` files are compiled into `.css` files.",
"main": "lib/compile.js",
"bin": {
@@ -36,7 +36,7 @@
"src"
],
"devDependencies": {
"tsbb": "3.0.0"
"tsbb": "3.0.1"
},
"dependencies": {
"@types/fs-extra": "9.0.12",
8 changes: 4 additions & 4 deletions src/compile.ts
Original file line number Diff line number Diff line change
@@ -45,9 +45,9 @@ export default async function compile(dir: string, option: ICompileOtion) {

export async function outputFile(data: IOutputFile, inputDir: string, outputDir: string) {
try {
const logPathIn = data.path.replace(process.cwd(), '');
const logPathIn = path.relative(process.cwd(), data.path);
data.path = data.path.replace(inputDir, outputDir).replace(/.less$/, '.css');
const logPathOut = data.path.replace(process.cwd(), '');
const logPathOut = path.relative(process.cwd(), data.path);
await log(logPathOut, logPathIn);
await fs.outputFile(data.path, data.css);
if (data.imports && data.imports.length > 0) {
@@ -62,8 +62,8 @@ async function log(output: string, input?: string) {
const pkg = await readPkgUp();
const projectName = pkg ? pkg?.packageJson.name : '';
if (input) {
console.log(`♻️ \x1b[32m ${projectName} =>\x1b[0m:`, input, '->', output);
console.log(`♻️ \x1b[32m ${projectName}\x1b[0m:`, input, '>', output);
} else {
console.log(`♻️ \x1b[32m ${projectName} =>\x1b[0m:`, 'Output one file: ->', output);
console.log(`♻️ \x1b[32m ${projectName}\x1b[0m:`, 'Output one file: >', output);
}
}