Bundle js modules with vite
This commit is contained in:
parent
138c163a6d
commit
d8db79e00c
12 changed files with 943 additions and 44 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
|||
node_modules
|
||||
static/style/tailwind.css
|
||||
.vscode/alive
|
||||
dist
|
||||
|
|
4
Makefile
4
Makefile
|
@ -1,8 +1,8 @@
|
|||
install: ## Install dependencies
|
||||
@qlot install ; npm i
|
||||
|
||||
css: ## Scan and build tailwindcss
|
||||
@npx tailwindcss -o ./static/style/tailwind.css --watch
|
||||
dev: ## Run dev mode
|
||||
@npm run dev
|
||||
|
||||
help: ## Show options
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
||||
|
|
922
package-lock.json
generated
922
package-lock.json
generated
File diff suppressed because it is too large
Load diff
20
package.json
20
package.json
|
@ -1,6 +1,22 @@
|
|||
{
|
||||
"name": "hp",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"daisyui": "^4.6.1",
|
||||
"tailwindcss": "^3.4.1"
|
||||
"autoprefixer": "^10.4.17",
|
||||
"daisyui": "^4.7.2",
|
||||
"postcss": "^8.4.35",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"vite": "^5.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"alpinejs": "^3.13.5",
|
||||
"htmx.org": "^1.9.10"
|
||||
}
|
||||
}
|
||||
|
|
6
postcss.config.js
Normal file
6
postcss.config.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
(defparameter *app*
|
||||
(lack:builder (:static
|
||||
:path "/static/"
|
||||
:root (asdf:system-relative-pathname :hp "static/"))
|
||||
:path "/dist/assets/"
|
||||
:root (asdf:system-relative-pathname :hp "assets/"))
|
||||
*raw-app*))
|
||||
|
||||
; for clackup cmd
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
(html
|
||||
(head
|
||||
(title "skyizwhite.dev")
|
||||
(script :src "/static/vendor/htmx.min.js")
|
||||
(script :defer t :src "/static/vendor/alpine.min.js")
|
||||
(link :href "/static/style/main.css" :rel "stylesheet")
|
||||
(link :href "/static/style/tailwind.css" :rel "stylesheet"))
|
||||
(script :type "module" :src "http://localhost:5173/@vite/client")
|
||||
(script :type "module" :src "http://localhost:5173/src/js/main.js"))
|
||||
(body :class "h-[100svh] w-screen"
|
||||
(main :class "h-full"
|
||||
pi:children)))))
|
||||
|
|
8
src/js/main.js
Normal file
8
src/js/main.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import './style.css'
|
||||
import HTMX from 'htmx.org'
|
||||
import Alpine from 'alpinejs'
|
||||
|
||||
window.htmx = HTMX;
|
||||
window.Alpine = Alpine
|
||||
|
||||
Alpine.start()
|
5
static/vendor/alpine.min.js
vendored
5
static/vendor/alpine.min.js
vendored
File diff suppressed because one or more lines are too long
1
static/vendor/htmx.min.js
vendored
1
static/vendor/htmx.min.js
vendored
File diff suppressed because one or more lines are too long
10
vite.config.js
Normal file
10
vite.config.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
manifest: true,
|
||||
rollupOptions: {
|
||||
input: 'src/js/main.js',
|
||||
},
|
||||
},
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue