Skip to content

Commit d789b69

Browse files
author
Andrey Fedoseev
committed
Switch from "6to5" to "Babel"
1 parent 80f303b commit d789b69

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ matrix:
1717
before_install:
1818
- npm install -g coffee-script
1919
- npm install -g less@1.7.4
20-
- npm install -g 6to5@3.5.3
20+
- npm install -g babel@4.3.0
2121
- gem install sass --version 3.3.14
2222
- gem install compass --version 1.0.1
2323
install:

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Dev
1414
* ``LESS_EXECUTABLE``
1515
- ``-C`` (``--no-cache``) flag is removed from SASS/SCSS compilers
1616
- Add ``STATIC_PRECOMPILER_LIST_FILES`` setting
17-
- Add `6to5 <https://6to5.org/>`_ compiler
17+
- Add `Babel <https://babeljs.io>`_ compiler
1818

1919
0.8
2020
===

README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Django Static Precompiler
33
=========================
44

5-
Django Static Precompiler provides template tags to compile CoffeeScript, SASS / SCSS and LESS.
5+
Django Static Precompiler provides template tags to compile CoffeeScript, SASS / SCSS, LESS, and Babel.
66
It works with both inline code and external files.
77

88
.. image:: https://travis-ci.org/andreyfedoseev/django-static-precompiler.svg?branch=master
@@ -101,7 +101,7 @@ General settings
101101

102102
STATIC_PRECOMPILER_COMPILERS = (
103103
'static_precompiler.compilers.CoffeeScript',
104-
'static_precompiler.compilers.ES6To5',
104+
'static_precompiler.compilers.Babel',
105105
'static_precompiler.compilers.SASS',
106106
'static_precompiler.compilers.SCSS',
107107
'static_precompiler.compilers.LESS',
@@ -161,16 +161,16 @@ Example::
161161
)
162162

163163

164-
6to5
165-
----
164+
Babel
165+
-----
166166

167167
``executable``
168-
Path to 6to5 compiler executable. Default: ``"6to5"``.
168+
Path to Babel compiler executable. Default: ``"babel"``.
169169

170170
Example::
171171

172172
STATIC_PRECOMPILER_COMPILERS = (
173-
('static_precompiler.compilers.ES6To5', {"executable": "/usr/bin/6to5"}),
173+
('static_precompiler.compilers.Babel', {"executable": "/usr/bin/babel"}),
174174
)
175175

176176

provision.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fi
1717

1818
sudo npm install -g coffee-script@1.7.1
1919
sudo npm install -g less@1.7.4
20-
sudo npm install -g 6to5@3.5.3
20+
sudo npm install -g babel@4.3.0
2121

2222

2323
##############
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding: utf-8
22
from static_precompiler.compilers.coffeescript import CoffeeScript
3-
from static_precompiler.compilers.es6to5 import ES6To5
3+
from static_precompiler.compilers.babel import Babel
44
from static_precompiler.compilers.scss import SASS, SCSS
55
from static_precompiler.compilers.less import LESS

static_precompiler/compilers/es6to5.py renamed to static_precompiler/compilers/babel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
from static_precompiler.utils import run_command
44

55

6-
class ES6To5(BaseCompiler):
6+
class Babel(BaseCompiler):
77

8-
name = "es6"
8+
name = "babel"
99
input_extension = "es6"
1010
output_extension = "js"
1111

12-
def __init__(self, executable="6to5"):
12+
def __init__(self, executable="babel"):
1313
self.executable = executable
14-
super(ES6To5, self).__init__()
14+
super(Babel, self).__init__()
1515

1616
def compile_file(self, source_path):
1717
return self.compile_source(self.get_source(source_path))

static_precompiler/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
COMPILERS = getattr(settings, "STATIC_PRECOMPILER_COMPILERS", (
1515
"static_precompiler.compilers.CoffeeScript",
16-
"static_precompiler.compilers.ES6To5",
16+
"static_precompiler.compilers.Babel",
1717
"static_precompiler.compilers.SASS",
1818
"static_precompiler.compilers.SCSS",
1919
"static_precompiler.compilers.LESS",

static_precompiler/tests/test_es6to5.py renamed to static_precompiler/tests/test_babel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# coding: utf-8
2-
from static_precompiler.compilers.es6to5 import ES6To5
2+
from static_precompiler.compilers.babel import Babel
33
from static_precompiler.exceptions import StaticCompilationError
44
from .test_coffeescript import clean_javascript
55
import pytest
66

77

88
def test_compile_file():
9-
compiler = ES6To5()
9+
compiler = Babel()
1010

1111
assert clean_javascript(compiler.compile_file("scripts/test.es6")) == """"use strict";\nconsole.log("Hello, World!");"""
1212

1313

1414
def test_compile_source():
15-
compiler = ES6To5()
15+
compiler = Babel()
1616

1717
assert clean_javascript(compiler.compile_source('console.log("Hello, World!");')) == """"use strict";\nconsole.log("Hello, World!");"""
1818

0 commit comments

Comments
 (0)