Skip to content

Commit

Permalink
chore(workflow): place Webpack-generated static files in `./static/di…
Browse files Browse the repository at this point in the history
…st` (#2130)
  • Loading branch information
nicomiguelino authored Nov 18, 2024
1 parent 7d99b0b commit 47947f4
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 18 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,3 @@ db.sqlite3

# Django
staticfiles/

# Static files
static/js/anthias.js*
static/js/settings.js*
static/css/anthias.css*
7 changes: 2 additions & 5 deletions docker/Dockerfile.server.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ WORKDIR /usr/src/app

{% if environment == 'production' %}
COPY --from=node-builder \
/app/static/css/ \
/usr/src/app/static/css/
COPY --from=node-builder \
/app/static/js/*.js* \
/usr/src/app/static/js/
/app/static/dist/ \
/usr/src/app/static/dist/
{% endif %}

ENV GIT_HASH={{ git_hash }}
Expand Down
2 changes: 1 addition & 1 deletion static/spec/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<script src="/static/js/bootstrap-datepicker.js"></script>
<script src="/static/js/bootstrap-timepicker.js"></script>
<script src="/static/js/moment.js"></script>
<script src="../js/anthias.js"></script>
<script src="../dist/js/anthias.js"></script>

</head>

Expand Down
2 changes: 1 addition & 1 deletion templates/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<meta content="/static/favicons/mstile-310x150.png" name="msapplication-wide310x150logo"/>
<meta content="/static/favicons/mstile-310x310.png" name="msapplication-square310x310logo"/>

<link href="{% static 'css/anthias.css' %}" type="text/css" rel="stylesheet"/>
<link href="{% static 'dist/css/anthias.css' %}" type="text/css" rel="stylesheet"/>

<link href="{% static 'fontawesome/css/all.css' %}" rel="stylesheet"/>

Expand Down
2 changes: 1 addition & 1 deletion templates/hotspot.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<title>Hotspot Page</title>
<link href="/static/css/anthias.css" rel="stylesheet"/>
<link href="/static/dist/css/anthias.css" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css?family=Plus Jakarta Sans" rel="stylesheet">
<link rel="icon" href="/static/favicons/favicon.ico">
<style type="text/css">
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
var wsAddresses = JSON.parse(document.getElementById('ws_addresses').textContent);
</script>

<script src="{% static 'js/anthias.js' %}"></script>
<script src="{% static 'dist/js/anthias.js' %}"></script>
<script src="{% static 'js/main.js' %}"></script>

<script id="asset-row-template" type="text/template">
Expand Down
2 changes: 1 addition & 1 deletion templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script src="{% static 'js/jquery.fileupload.js' %}"></script> <!-- needs jqueryui.widget -->
<script src="{% static 'js/bootstrap-datepicker.js' %}"></script>

<script src="{% static 'js/settings.js' %}"></script>
<script src="{% static 'dist/js/settings.js' %}"></script>
{% endblock %}

{% block content %}
Expand Down
2 changes: 1 addition & 1 deletion templates/splash-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% load static %}
<meta charset="utf-8"/>
<title>Welcome to Anthias</title>
<link href="{% static 'css/anthias.css' %}" rel="stylesheet"/>
<link href="{% static 'dist/css/anthias.css' %}" rel="stylesheet"/>
<link href="https://fonts.googleapis.com/css?family=Plus Jakarta Sans" rel="stylesheet">
<link rel="icon" href="/static/favicons/favicon.ico">
<style type="text/css">
Expand Down
5 changes: 3 additions & 2 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ module.exports = {
"settings": "./static/js/settings.coffee",
},
output: {
path: path.resolve(__dirname, "static"),
filename: "js/[name].js"
path: path.resolve(__dirname, "static/dist"),
filename: "js/[name].js",
clean: true,
},
plugins: [
new MiniCssExtractPlugin({
Expand Down

0 comments on commit 47947f4

Please sign in to comment.