Skip to main content

Integrate babeljs with django

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

# django-babeljs #
A simple interface to babel.js: transpile your javascript template into a javascript tag.

## install ##
Just include `babeljs` into your `INSTALLED_APPS`
```
#!python

INSTALLED_APPS += [ "babeljs" ]
```


## templatetag ##

Load the templatetag
```
#!html
{% load babeljs %}
```

### babeljs ###
Include the babeljs file(s) as `<scrip...></script>` tag(s).
It is useful only for in browser transpilation (ie: no nodejs is installed), otherwise can be omitted
```
#!html
{% babeljs %}
```

### babel ###
load file.js, try to transpile it with babeljs and copy the result into the template (acts the same as the `include` tag)
```
#!html
{% babel "file.js" %}
```

transpile a react jsx file
```
#!html
{% babel "file.jsx" %}
```


## settings ##

### BABELJS_BABEL ###
Provide a custom babeljs script.

### BABELJS_ROOT ###
Where to find the babeljs script.

### BABELJS_MINIFIED ###
If use or not the minified version [default=not DEBUG].
Useful only for default babeljs script.

### BABELJS_CACHE_BACKEND ###
Use a specific cache backend for compiled js [default="default"].

### BABELJS_CACHE_TIMEOUT ###
The number of seconds the transpiled code should be stored in the cache, 0 for never cache it, None for cache it forever [default=300].

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_babeljs-0.1.3-py2.py3-none-any.whl (680.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_babeljs-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_babeljs-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 243c9f506c8563a7fef81899802c9b1ceb0654960a41c0d5162264c733b0a4aa
MD5 12c35b8ac170dff1f5180a74be5205dd
BLAKE2b-256 a80aa921d22de78053ee4f03b6ea6e35c6c2f5ea6609386648475db1bee13707

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page