diff --git a/package.json b/package.json index 4e4e83b..60583e9 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { - "name": "@e-ops-pf/starter-kit", - "version": "1.0.0", - "private": true, - "scripts": { - "build": "vite build" - }, - "devDependencies": { - "vite": "^5.0.0" - } - } + "name": "@e-ops-pf/starter-kit", + "version": "1.0.0", + "private": true, + "scripts": { + "build": "vite build" + }, + "devDependencies": { + "vite": "^5.0.0" + } +} diff --git a/resources/css/app.css b/resources/css/app.css new file mode 100644 index 0000000..94ecfd4 --- /dev/null +++ b/resources/css/app.css @@ -0,0 +1,18 @@ +@source inline('loading-bars loading-infinity loading-circle loading-spinner loading-ring loading-ball') + + +#loading-overlay { + display: none; + position: fixed; + top:0; + left:0; + width: 100%; + height: 100%; + min-height: 100vh; + background: rgba(45, 45, 65, 0.6); + z-index: 100; +} + +#loading-overlay div { + margin: auto; +} \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 7c9db83..9831417 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,12 +3,25 @@ import path from 'path' export default defineConfig({ build: { - outDir: 'public/js/e-ops-pf/starter-kit', + outDir: 'public', // we handle subfolders manually emptyOutDir: true, rollupOptions: { - input: 'resources/js/app.js', + input: { + js: 'resources/js/app.js', + css: 'resources/css/app.css', + }, output: { - entryFileNames: 'app.js', + entryFileNames: (chunkInfo) => { + return chunkInfo.name === 'js' + ? 'js/e-ops-pf/starter-kit/app.js' + : 'css/e-ops-pf/starter-kit/app.js' // css is still treated as a chunk + }, + assetFileNames: (assetInfo) => { + if (assetInfo.name.endsWith('.css')) { + return 'css/e-ops-pf/starter-kit/app.css' + } + return 'assets/[name].[ext]' + }, }, }, },