Package: django-static-precompiler
Django Static PrecompilerDjango Static Precompiler provides template tags and filters to compile
CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and
Handlebars. It works with both inline code and external files.DocumentationDocumentation is available athttps://django-static-precompiler.readthedocs.io.Installpipinstalldjango-static-precompilerUse in templates{% load compile_static %}
{% load static %}<scriptsrc="{% static "path/to/script.coffee"|compile%}"></script><linkrel="stylesheet"href="{% static "path/to/styles1.less"|compile%}"/><linkrel="stylesheet"href="{% static "path/to/styles2.scss"|compile%}"/>Use in Python>>>fromstatic_precompiler.utilsimportcompile_static>>>compile_static("styles.scss")"COMPILED/styles.css"Python & Django compatibilitydjango-static-precompilerPythonDjango2.2+3.6+2.0 - 4.12.13.6+2.0 - 4.02.03.4+1.9 - 3.21.7-1.82.7+1.7 - 2.21.62.7+1.7 - 1.111.52.7+1.6 - 1.101.1-1.42.7+1.6 - 1.91.02.7+1.6 - 1.7Changelog2.4DeprecationRuby-based Sass compiler is deprecated and will be removed in 3.0NewAdded support for Dart Sass, see documentation on how to enable it.
Dart Sass will become the default Sass compiler starting from 3.0BugfixesFix the bug with a greedy regex in the URL converterMiscEnsure compatibility with the latest versions of compilers:coffeescript@2.7.0 (may break compatibility with older versions)livescript@1.6.0less@4.1.3handlebars@4.7.72.3Fix incorrect source map URL withlibsass2.2Add support for Django 4.12.1Drop Python 3.5 supportDrop Django 1.x supportAdd support for Django 4.02.0Drop Python 2.x supportAdd support for Django 3.0 and 3.11.8.2Addclean_cssoption to LESS compilerFix URL converter to properly handleurl(..)not followed
directly by;1.8.1Fixsetup.pyto add compatibility with Python 3.4 and below.1.8Remove deprecated settings:COFFEESCRIPT_EXECUTABLE,SCSS_EXECUTABLE,SCSS_USE_COMPASS,LESS_EXECUTABLEAdd--ignore-dependenciesoption tocompilestaticcommandAdd--delete-stale-filesoption tocompilestaticcommand1.7.1Bugfix: properly handle the URLs containing parenthesis or quotes1.7Prevent detection of imports in comments (SCSS)Add support for Django 2.01.6Add support for Django 1.11Drop support for Django 1.6Addinclude_pathoption to LESS compilerTake account ofload_pathsoption when doing inline compilation
withlibsassBugfix: take account of additional compiler options when doing
inline compilation with SASS1.5Add support for Django 1.10 and Python 3.5Improve support forload_pathssetting in SCSS/SASS compilers.1.4Fix therun_commandutility function to rely on process return
code rather than stderr to determine if compilation has finished
successfully. WARNING! Changes inrun_commandare backward
incompatible. If you use this function in your custom compiler you
should update your code.1.3.1Add support for--presetsoption in Babel compiler. See babel-cli
[options <https://babeljs.io/docs/usage/options/>]{.title-ref} for
more information.1.3Fix Stylus compiler to actually enable support for detecting changes
in imported filesAddprecisionoption to SASS / SCSS / LibSass compilers. Set it to
8 or more if you compile Bootstrap.Addoutput_styleoption to SASS / SCSS / LibSass compilers.Enable verbose output forcompilestaticmanagement command1.2Add LiveScript compilerAdd support for--global-varoption in LESS compilerAdd SCSS / SASS compiler based on Libsass1.1Add source maps support for SASS/SCSSAdd source maps support for LESSAdd source maps support for CoffeeScriptAdd source maps support for StylusAdd source maps support for BabelAddHandlebarscompilerAdd support for Django 1.9Addpluginsparameter to Babel compilerAddload_pathsparameter to SASS/SCSS compilers1.0.1Addmodulesparameter to Babel compilerAllow to install Watchdog withpip install django-static-precompiler[watch]1.0Addcompiletemplate filterDeprecate{% compile %}template tagThe following compiler specific template tags are REMOVED:{% coffeescript %}{% inlinecoffeescript %}{% sass %}{% inlinesass %}{% scss %}{% inlinescss %}{% less %}{% inlineless %}AddStyluscompiler0.9Compiler options are specified withSTATIC_PRECOMPILER_COMPILERSsetting.The following settings are DEPRECATED:COFFEESCRIPT_EXECUTABLESCSS_EXECUTABLESCSS_USE_COMPASSLESS_EXECUTABLE-C(--no-cache) flag is removed from SASS/SCSS compilersAddSTATIC_PRECOMPILER_LIST_FILESsettingAddBabelcompiler0.8Add{% inlinecompile %}template tagThe following compiler specific template tags are DEPRECATED:{% coffeescript %}{% inlinecoffeescript %}{% sass %}{% inlinesass %}{% scss %}{% inlinescss %}{% less %}{% inlineless %}Use Django 1.7 migrationsBUGFIX: fix sass imports from scss and vice versaBUGFIX: make sure thatcompilestaticworks ifwatchdogisn't
installed.BUGFIX: fix compilation error when dependency file was removed or
renamed0.7Addcompilestaticmanagement command (replacesstatic_precompiler_watch)AddSTATIC_PRECOMPILER_DISABLE_AUTO_COMPILEto settingsAddSTATIC_PRECOMPILER_CACHE_NAMEto settingsBugfixes0.6AddSTATIC_PRECOMPILER_PREPEND_STATIC_URLto settingsAdd{% compile %}template tag0.5.3Update the parsing of@importstatements. Fix the bug with URLs
containing commas.0.5.2static_precompiler_watch: watch for changes in all directories
handled by static finders, not onlySTATIC_ROOTstatic_precompiler_watch: add--no-initial-scanoption0.5.1Fix SCSS compilation error when importing Compass styles0.5Add Python 3 support0.4Addcompile_staticandcompile_static_lazyutility functions.0.3Bug fixesAdd Windows compatibility0.2Reduce the max length of varchar fields in Dependency model to meet
MySQL limitationsstatic_precompiler_watch: don't fall with exception on
compilation errors or if source file is not found0.1Initial release