Skip to content

Commit

Permalink
Use collected or project file depending if collector enabled.
Browse files Browse the repository at this point in the history
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: jazzband#749
  • Loading branch information
camilotorresf committed Aug 17, 2021
1 parent cd9adae commit c67514a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pipeline/compilers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c67514a

Please sign in to comment.