0

Im using Laravel with FilamentPHP, admin panel is ready. Now i started to add the frontend part, how can i investigate why the .css file is missing in /public/build/assets?

Tried npm run dev and npm run build.

Thank you

My vite config:

import { defineConfig } from 'vite';
import laravel, { refreshPaths } from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        // laravel([
        //     'resources/css/app.css',
        //     'resources/js/app.js',
        // ]),
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: [
                ... refreshPaths,
                'app/Livewire/**',
               'app/Filament/**',
            ],
        }),
    ],
});

My app alyout:

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title> {{ isset($title) ? $title . ' - ' : '' }}{{ config('app.name', '') }}</title>

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />

    <!-- Scripts -->
    @vite(['resources/css/app.css', 'resources/js/app.js'])

    <!-- Styles -->
    @livewireStyles


</head>

Tailwind config file:

import defaultTheme from 'tailwindcss/defaultTheme';
import forms from '@tailwindcss/forms';
import typography from '@tailwindcss/typography';

/** @type {import('tailwindcss').Config} */
export default {
    content: [
        './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
        './storage/framework/views/*.php',
        './resources/views/**/*.blade.php',
    ],

    theme: {
        extend: {
            fontFamily: {
                sans: ['Figtree', ...defaultTheme.fontFamily.sans],
            },
        },
    },

    plugins: [forms, typography],
};

Postcss config:

export default {
    plugins: {
        tailwindcss: {},
        autoprefixer: {},
    },
};

package.json file:

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.0",
        "autoprefixer": "^10.4.20",
        "axios": "^1.6.4",
        "laravel-vite-plugin": "^1.0",
        "postcss": "^8.4.47",
        "tailwindcss": "^3.4.12",
        "vite": "^5.4.7"
    }
}

λ npm run build

> build
> vite build

vite v5.4.7 building for production...
✓ 53 modules transformed.
public/build/manifest.json            0.29 kB │ gzip:  0.15 kB
public/build/assets/app-l0sNRNKZ.js   0.00 kB │ gzip:  0.02 kB
public/build/assets/app-z-Rg4TxU.js  35.05 kB │ gzip: 14.08 kB
✓ built in 1.70s

I tried to delete node_modules and re install with npm i. Updated node also to v20.17.0

1 Answer 1

0

Tailwind's directives were missing in the resources/app.css file.

@tailwind base;
@tailwind components;
@tailwind utilities;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.