publish built js files

This commit is contained in:
Root.pachups
2025-06-26 03:17:33 +00:00
parent fc492a18c1
commit 4328f7d9aa
3 changed files with 32 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
{
"name": "@e-ops-pf/starter-kit",
"version": "1.0.0",
"private": true,
"scripts": {
"build": "vite build"
},
"devDependencies": {
"vite": "^5.0.0"
}
}
+1
View File
@@ -0,0 +1 @@
document.addEventListener("alpine:init",()=>{Alpine.directive("confirm-modal",(c,a,{evaluate:l})=>{c.addEventListener("click",m=>{m.preventDefault();const o=document.getElementById("global-confirm-modal"),e=c.dataset;console.log("Dataset:",e),document.getElementById("confirm-title").innerHTML=e.title||"Confirm Action",document.getElementById("confirm-message").innerHTML=e.message||"Are you sure you want to proceed?",document.getElementById("confirm-cancel").innerHTML=e.cancelLabel||"Cancel",document.getElementById("confirm-confirm").innerHTML=e.confirmLabel||"Confirm",document.getElementById("confirm-confirm").addEventListener("click",()=>{var d;if(e.url)window.location.href=e.url;else if(e.action){const t=document.createElement("form");t.method="POST",t.action=e.action;const i=(d=document.querySelector('meta[name="csrf-token"]'))==null?void 0:d.content;if(i){const n=document.createElement("input");n.type="hidden",n.name="_token",n.value=i,t.appendChild(n)}if(e.method&&e.method.toUpperCase()!=="POST"){const n=document.createElement("input");n.type="hidden",n.name="_method",n.value=e.method,t.appendChild(n)}document.body.appendChild(t),t.submit()}else console.error("No URL or action specified for confirmation."),o.close()}),document.getElementById("confirm-cancel").addEventListener("click",()=>{o.close()}),o.showModal()})})});
+20
View File
@@ -0,0 +1,20 @@
import { defineConfig } from 'vite'
import path from 'path'
export default defineConfig({
build: {
outDir: 'public/js/e-ops-pf/starter-kit',
emptyOutDir: true,
rollupOptions: {
input: 'resources/js/app.js',
output: {
entryFileNames: 'app.js',
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/js'),
},
},
})