Add Babel JavaScript compiler
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
e1461d847c
commit
307b0d2923
3
babel.config.json
Normal file
3
babel.config.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"presets": ["@babel/preset-env"]
|
||||
}
|
||||
2
js/dist/.gitignore
vendored
Normal file
2
js/dist/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/*
|
||||
!/.gitignore
|
||||
@ -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",
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 %}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user