django-compressor-toolkit | Simply enable SCSS and ES6 in your Django project | Style Language library
kandi X-RAY | django-compressor-toolkit Summary
kandi X-RAY | django-compressor-toolkit Summary
Simply enable SCSS and ES6 in your Django project
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert data urls .
- Return a set of all static directories .
- Create input file .
- Add the suffix to the URL .
- Get the absolute path to a file .
django-compressor-toolkit Key Features
django-compressor-toolkit Examples and Code Snippets
// settings.py
COMPRESS_PRECOMPILERS = (
('module', 'compressor_toolkit.precompilers.ES6Compiler'),
)
{# Django template #}
{% load compress %}
{% compress js %}
{% endcompress %}
// app/static/app/scripts.js
import Framework from 'base/
// settings.py
COMPRESS_PRECOMPILERS = (
('text/x-scss', 'compressor_toolkit.precompilers.SCSSCompiler'),
)
{# Django template #}
{% load compress %}
{% compress css %}
{% endcompress %}
/* app/static/app/layout.scss */
@import "base/var
git clone https://github.com/kottenator/django-compressor-toolkit.git
cd django-compressor-toolkit
pip install -e '.[test]'
npm install
py.test
Community Discussions
Trending Discussions on django-compressor-toolkit
QUESTION
I would like to use the import feature in ES6 in index.html in django.
I do not want to compile to ES5 for browser compatibility. I would like to assume that all the users will have ES6 compatible browsers.
Therefore I do not need a ES6 to ES5 compiler such as Babel: https://github.com/kottenator/django-compressor-toolkit
I simply would like to serve the ES6 Javascript and the browser to compile it if it can.
I tried:
...ANSWER
Answered 2019-Jan-09 at 14:24I tested on my local environment. It's working fine. I follow these steps:
In
settings.py
add thisSTATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ]
In template use this and keep
app.js
inPROJECT_DIRECTORY/static/
folder.My
app.js
code written fromhttps://raw.githubusercontent.com/benmvp/learning-es6/master/examples/es6/block-scoping.js
My html:
QUESTION
I'm building a bilingual site, which has both RTL and LRT content. Mezzanine comes with a twitter-bootstrap theme, which doesn't support RTL as well as zurb-foundation does. So I'm trying to create a new Mezzanine theme that would use foundation for sites.
I'm having trouble structuring my project in a way that django-compressor would understand, with minimal 3rd party dependencies.
The structure that I'd like to emulate is the one in mezzanine-themes. However, it is not setup to use SCSS. I've also installed django-compressor-toolkit to deal with SCSS.
The problem now is that I don't know how to structure the static files in the theme app to get compressor to find them.
My hunch is that I have to make compressor-toolkit find the foundation-sites
file in node_modules
, but I can't figure how to do that out from reading the docs.
I could put all of the foundation files in the same static folder, but then I lose the nice package management (along with other drawbacks).
Any recommendations?
Many thanks in advance.
Below is the error that compressor gives when it reaches the {% compress css %}
template tag.
ANSWER
Answered 2017-Nov-13 at 08:49Found it! I had to use --include-path
for the node-sass
module.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-compressor-toolkit
You can use django-compressor-toolkit like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page