Skip to content

Commit

Permalink
Add Babel JavaScript compiler
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Sep 4, 2020
1 parent e1461d8 commit 307b0d2
Show file tree
Hide file tree
Showing 77 changed files with 1,800 additions and 18 deletions.
3 changes: 3 additions & 0 deletions babel.config.json
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
2 changes: 2 additions & 0 deletions js/dist/.gitignore
@@ -0,0 +1,2 @@
/*
!/.gitignore
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -37,6 +37,9 @@
"zxcvbn": "4.4.2"
},
"devDependencies": {
"@babel/cli": "^7.11.5",
"@babel/core": "^7.11.5",
"@babel/preset-env": "^7.11.5",
"eslint": "^7.5.0",
"eslint-plugin-compat": "^3.8.0",
"eslint-plugin-no-jquery": "^2.5.0",
Expand All @@ -50,9 +53,10 @@
"lodash": "^4.17.19"
},
"scripts": {
"postinstall": "yarn run --silent css-compile --quiet --style=compressed",
"postinstall": "yarn run --silent css-compile --quiet --style=compressed && yarn run --silent js-compile --quiet",
"css-compile": "sass themes/pmahomme/scss:themes/pmahomme/css themes/original/scss:themes/original/css themes/metro/scss:themes/metro/css themes/bootstrap/scss:themes/bootstrap/css",
"css-lint": "stylelint --syntax scss \"themes/**/scss/*.scss\"",
"js-lint": "eslint js"
"js-lint": "eslint js/src",
"js-compile": "babel js/src -d js/dist"
}
}
3 changes: 2 additions & 1 deletion templates/scripts.twig
@@ -1,5 +1,6 @@
{% for file in files %}
<script data-cfasync="false" type="text/javascript" src="{{ base_dir }}js/{{ file.filename }}
<script data-cfasync="false" type="text/javascript" src="{{ base_dir }}js/
{{- file.filename starts with 'vendor/' ? file.filename : 'dist/' ~ file.filename -}}
{{- '.php' in file.filename ? get_common(file.params|merge({'v': version})) : '?v=' ~ version|url_encode }}"></script>
{% endfor %}

Expand Down
1,802 changes: 1,787 additions & 15 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 307b0d2

Please sign in to comment.