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

Import in vite #124

Closed
hadi60 opened this issue Jan 18, 2025 · 1 comment
Closed

Import in vite #124

hadi60 opened this issue Jan 18, 2025 · 1 comment
Labels
question Further information is requested

Comments

@hadi60
Copy link

hadi60 commented Jan 18, 2025

با لاراول و وایت دارم استفاده می کنم توی مد dev خیلی هم خوب کار می کنه ولی وقتی build می کنی می ریزه به هم

app.js

import '@majidh1/jalalidatepicker/dist/jalalidatepicker'
window.jalaliDatepicker = window.jalaliDatepicker || jalaliDatepicker;
<script type="module">
    jalaliDatepicker.startWatch({});
</script>
edit:3705 Uncaught ReferenceError: jalaliDatepicker is not defined
    at HTMLDocument.<anonymous> (edit:3705:9)
@hadi60 hadi60 changed the title import in vite Import in vite Jan 18, 2025
@majidh1
Copy link
Owner

majidh1 commented Jan 22, 2025

برای import از

import "@majidh1/jalalidatepicker"; 

استفاده کنید

شما css پلاگین هم باید import کنید

@import "@majidh1/jalalidatepicker/dist/jalalidatepicker.min.css";

اگر همچنان مشکل هست احتمالا از تنظیمات vite هست و باید کاری کنید که پکیج های خارجی رو در بیلد نهایی بسازد

@majidh1 majidh1 added the question Further information is requested label Jan 22, 2025
@majidh1 majidh1 closed this as completed Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants