From b7f2ef6b2c56553c070085446c12a0c4c5b39113 Mon Sep 17 00:00:00 2001 From: Lenni Date: Wed, 22 Mar 2023 23:40:21 +0100 Subject: [PATCH 1/4] enable skipRebase again to bypass auto rebase with output --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index bfd06df..23fe15c 100644 --- a/index.js +++ b/index.js @@ -124,7 +124,7 @@ function cli(process, beforeMinifyCallback) { fs.mkdirSync(options.output, {recursive: true}); } - if (inputOptions.withRebase && ('output' in inputOptions) && inputOptions.output.length > 0) { + if (inputOptions.withRebase && ('output' in inputOptions) && inputOptions.output.length > 0 && !inputOptions.skipRebase) { if (isDirectory(path.resolve(inputOptions.output))) { options.rebaseTo = path.resolve(inputOptions.output); } else { From f981209295639f6e3b2fb76dcb5a8a6d30f73240 Mon Sep 17 00:00:00 2001 From: Lenni Date: Wed, 22 Mar 2023 23:42:17 +0100 Subject: [PATCH 2/4] add skip-rebase flag to program --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 23fe15c..d217d1f 100644 --- a/index.js +++ b/index.js @@ -38,6 +38,7 @@ function cli(process, beforeMinifyCallback) { .option('--source-map', 'Enables building input\'s source map') .option('--source-map-inline-sources', 'Enables inlining sources inside source maps') .option('--with-rebase', 'Enable URLs rebasing') + .option('--skip-rebase', 'Disable URLs rebasing') .option('--watch', 'Runs CLI in watch mode'); program.on('--help', function () { From 76891c1f1f609a095083f1f48ced67350f2c29a8 Mon Sep 17 00:00:00 2001 From: Lenni009 Date: Thu, 23 Mar 2023 00:30:09 +0100 Subject: [PATCH 3/4] update readme to reflect skip-rebase changes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 49a7a9f..99dcffe 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,7 @@ clean-css-cli 4.0 introduces some breaking changes: --source-map Enables building input's source map --source-map-inline-sources Enables inlining sources inside source maps --with-rebase Enables URLs rebasing +--skip-rebase Disables URLs rebasing (overwrites with-rebase). ``` ## Compatibility modes @@ -423,7 +424,7 @@ which sets all units rounding precision to 3 digits except `px` unit precision o ## How to rebase relative image URLs? -clean-css-cli will rebase paths it automatically for you when full paths to input files are passed, and `--with-rebase` & `--output` options are used, e.g +clean-css-cli will rebase paths automatically for you when full paths to input files are passed, and `--with-rebase` & `--output` options are used, but not if `--skip-rebase` is used, e.g ```css /*! one.css */ From f9ba39002c7ddd9b1990b616114f1751a12d918a Mon Sep 17 00:00:00 2001 From: Lenni009 Date: Thu, 23 Mar 2023 00:37:24 +0100 Subject: [PATCH 4/4] actually not sure which one would win --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 99dcffe..e8a9c99 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ clean-css-cli 4.0 introduces some breaking changes: --source-map Enables building input's source map --source-map-inline-sources Enables inlining sources inside source maps --with-rebase Enables URLs rebasing ---skip-rebase Disables URLs rebasing (overwrites with-rebase). +--skip-rebase Disables URLs rebasing ``` ## Compatibility modes