From c67514ae828f79454320a37b0aeb154c7359e19c Mon Sep 17 00:00:00 2001 From: camilo Date: Tue, 17 Aug 2021 12:24:48 -0400 Subject: [PATCH] Use collected or project file depending if collector enabled. If the collector is enabled (PIPELINE_COLLECTOR_ENABLED is True), use the collected file. If the disabled (False), use the original project source file to check if it is outdated and pick up the changes. This will allow for static files (in particular less CSS compiler) files to do relative imports from different apps. See: https://github.com/jazzband/django-pipeline/issues/749 --- pipeline/compilers/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pipeline/compilers/__init__.py b/pipeline/compilers/__init__.py index f6978a15..c6ebeff2 100644 --- a/pipeline/compilers/__init__.py +++ b/pipeline/compilers/__init__.py @@ -32,10 +32,12 @@ def _compile(input_path): infile = self.storage.path(input_path) except NotImplementedError: infile = finders.find(input_path) - project_infile = finders.find(input_path) outfile = compiler.output_path(infile, compiler.output_extension) - outdated = compiler.is_outdated(project_infile, outfile) - compiler.compile_file(project_infile, outfile, + if not settings.PIPELINE_COLLECTOR_ENABLED: + # override the input file with the original source from the project + infile = finders.find(input_path) + outdated = compiler.is_outdated(infile, outfile) + compiler.compile_file(infile, outfile, outdated=outdated, force=force, **compiler_options)