Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during build #184

Open
felrib opened this issue Oct 10, 2024 · 4 comments
Open

Error during build #184

felrib opened this issue Oct 10, 2024 · 4 comments

Comments

@felrib
Copy link

felrib commented Oct 10, 2024

Hi! When using npx vite dev it works great, but I can't find a config that makes it work with npx vite build. Is it possible?

$ npx vite build
error during build:
[vite]: Rollup failed to resolve import "virtual:livewire-hot-reload" from "/home/felipe/projects/myapp/resources/js/app.js".
@fabio-ivona
Copy link
Member

Hi, this package is for dev only, should not go in production builds

@felrib
Copy link
Author

felrib commented Oct 30, 2024

Yes, but is there some way to have the "same code" during dev and deploy? IE, I have this piece of code on app.js that I must remove or comment if needed to deploy.

import { livewire_hot_reload } from 'virtual:livewire-hot-reload';
livewire_hot_reload();

@fabio-ivona
Copy link
Member

hmm, I've a lot of projects where I build for prod without any issue, could you share your package.json?

@felrib
Copy link
Author

felrib commented Nov 22, 2024

Sure, here it is:

{
    "private": true,
    "type": "module",
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@defstudio/vite-livewire-plugin": "^2.0.5",
        "@iconify/tailwind": "^0.1.4",
        "@tailwindcss/forms": "^0.5.9",
        "alpinejs": "^3.14.1",
        "axios": "^1.7.7",
        "laravel-vite-plugin": "^1.0.5",
        "postcss": "^8.4.47",
        "tailwindcss": "^3.4.13",
        "vite": "^5.4.8"
    },
    "dependencies": {
        "@alpinejs/collapse": "^3.14.1",
        "@alpinejs/focus": "^3.14.1",
        "@fontsource/inter": "^5.1.0",
        "@hotwired/turbo": "^8.0.10",
        "@iconify-json/heroicons": "^1.2.1",
        "@iconify-json/nimbus": "^1.2.1",
        "@iconify-json/uil": "^1.2.1",
        "@ryangjchandler/alpine-tooltip": "^2.0.1",
        "autoprefixer": "^10.4.20",
        "chart.js": "^4.4.4",
        "image-blob-reduce": "^4.1.0",
        "imask": "^7.6.1",
        "laravel-echo": "^1.16.1",
        "pica": "^9.0.1",
        "pusher-js": "^8.3.0",
        "tippy.js": "^6.3.7"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants