Skip to content

Commit

Permalink
Use Vite and npm for HTMX
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodwyer committed Sep 6, 2024
1 parent 0d516a1 commit fc06c99
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 6 deletions.
1 change: 0 additions & 1 deletion airlock/static/htmx-1.9.10.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion airlock/templates/file_browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% endblock full_width_content %}

{% block extra_js %}
<script type="text/javascript" src="{% static 'htmx-1.9.10.min.js' %}"></script>
<script type="text/javascript" src="{% static 'vendor/htmx.min.js' %}"></script>
{% django_htmx_script %}
<script src="{% static 'assets/file_browser/index.js' %}"></script>
{% vite_asset "assets/src/scripts/resizer.js" %}
Expand Down
76 changes: 74 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
"autoprefixer": "^10.4.19",
"postcss": "^8.4.40",
"tailwindcss": "^3.4.7",
"vite": "^5.3.5"
"vite": "^5.3.5",
"vite-plugin-static-copy": "^1.0.6"
},
"dependencies": {
"@fontsource-variable/public-sans": "^5.0.19"
"@fontsource-variable/public-sans": "^5.0.19",
"htmx.org": "^1.9.12"
}
}
11 changes: 11 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";

export default defineConfig({
base: "/static/",
Expand All @@ -15,4 +16,14 @@ export default defineConfig({
server: {
origin: "http://localhost:5173",
},
plugins: [
viteStaticCopy({
targets: [
{
src: "./node_modules/htmx.org/dist/htmx.min.js",
dest: "vendor",
},
],
}),
],
});

0 comments on commit fc06c99

Please sign in to comment.