Use flask-webassets to version js/css bundle
This commit is contained in:
parent
b67b4cca44
commit
dea0962f7c
@ -4,10 +4,14 @@ from atst.home import home
|
|||||||
environment = Environment()
|
environment = Environment()
|
||||||
|
|
||||||
css = Bundle(
|
css = Bundle(
|
||||||
"../scss/atat.scss",
|
"../static/assets/index.css",
|
||||||
filters="scss",
|
output="../static/assets/styles.%(version)s.css",
|
||||||
output="../static/assets/out.%(version)s.css",
|
|
||||||
depends=("**/*.scss"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
environment.register("css", css)
|
environment.register("css", css)
|
||||||
|
|
||||||
|
js = Bundle(
|
||||||
|
'../static/assets/index.js',
|
||||||
|
output='../static/assets/index.%(version)s.js'
|
||||||
|
)
|
||||||
|
environment.register('js_all', js)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "parcel watch static/js/index.js -d static/assets -o index.js --no-autoinstall",
|
"watch": "parcel watch static/js/index.js -d static/assets -o index.js --no-autoinstall",
|
||||||
"build": "parcel build static/js/index.js -d static/assets -o index.js --no-autoinstall",
|
"build": "parcel build static/js/index.js -d static/assets -o index.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<title>{% block title %}JEDI{% endblock %}</title>
|
<title>{% block title %}JEDI{% endblock %}</title>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='assets/index.css') }}">
|
{% assets "css" %}
|
||||||
|
<link rel="stylesheet" href="{{ ASSET_URL }}" type="text/css">
|
||||||
|
{% endassets %}
|
||||||
<link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
|
<link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
|
||||||
</head>
|
</head>
|
||||||
<body class="{% if g.modalOpen %} modalOpen{% endif %}">
|
<body class="{% if g.modalOpen %} modalOpen{% endif %}">
|
||||||
@ -32,6 +34,8 @@
|
|||||||
{% include 'footer.html' %}
|
{% include 'footer.html' %}
|
||||||
|
|
||||||
{% block modal %}{% endblock %}
|
{% block modal %}{% endblock %}
|
||||||
<script src="{{ url_for('static', filename='assets/index.js') }}"></script>
|
{% assets "js_all" %}
|
||||||
|
<script src="{{ ASSET_URL }}"/>
|
||||||
|
{% endassets %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user