Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler optimization #720

Open
Pyvonix opened this issue May 29, 2020 · 0 comments
Open

Compiler optimization #720

Pyvonix opened this issue May 29, 2020 · 0 comments

Comments

@Pyvonix
Copy link

Pyvonix commented May 29, 2020

It's impossible to use Django-pipeline to build Bootstrap directly by configuration...

Exemple:

PIPELINE = {
    'COMPILERS': (
        'pipeline.compilers.sass.SASSCompiler',
    ),
    'SASS_BINARY': '/usr/bin/sass',
    'STYLESHEETS': {
        'bootstrap': {
            'source_filenames': (
               'my_bootstrap/_variables.scss',
               'bootstrap/bootstrap.scss',
               'my_bootstrap/_bootstrap.scss',
             ),
            'output_filename': 'css/bootstrap.min.css',
            'extra_context': {
                'media': 'screen,projection',
            }
        }
    }
}

The only way is to do it, is to create a file like:

@import "my_bootstrap/_variables";
@import "bootstrap/bootstrap";
@import "my_bootstrap/_bootstrap";

And call this file in source_filenames to compile it:

'source_filenames': (
   'build_bootstrap.scss',
)

This problem refers to the approach of the compiler who iter on each file specified in source_filenames to execute the command :

  • actual behavior generate one .css for each .scss
  • sould be one .css for every .scss give by source_filenames.

This could be an important optimization because we compile one file by section. Not anymore one file for one file and concatenate them to produce the final file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant