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

compatibility with vite #1455

Merged
merged 7 commits into from
Oct 28, 2022
Merged

compatibility with vite #1455

merged 7 commits into from
Oct 28, 2022

Conversation

wikigods
Copy link
Contributor

@wikigods wikigods commented Sep 2, 2022

Support for vite
Today looking for a solution to use vite in the modules I found a temporary solution, I am open to suggestions for a better implementation in code. (Sorry my english is not very good)
attached images of the result I obtained
Screenshot_118
Screenshot_119
Screenshot_120
Screenshot_121

@kylecmccandless
Copy link

this looks like it checks out. whats the plan to merge?

@stale
Copy link

stale bot commented Oct 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 4, 2022
@stale stale bot closed this Oct 11, 2022
@razavistag
Copy link

This merge has not taken any effect as well as Vite configuration does not initiate on modules we newly created. @wikigods @kylecmccandless @wuwx @dydx @jnbn
Please update the documentation. so developers can easily understand if there are any command to put for generate vite configuration

NOT WORKING - SOLUTION DOES NOT TAKE EFFECT ON NEWLY CREATED PROJECT

@kylecmccandless
Copy link

I'll look into it tonight and update before 10pm est.

@dcblogdev dcblogdev reopened this Oct 21, 2022
@stale stale bot removed the stale label Oct 21, 2022
{{-- Laravel Mix - CSS File --}}
{{-- <link rel="stylesheet" href="{{ mix('css/$LOWER_NAME$.css') }}"> --}}
{{-- Laravel Vite - CSS File --}}
{{-- {{ module_vite('build-$LOWER_NAME$', 'Resources/assets/sass/app.scss') }} --}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need the {{ inside the {{ same for the closing ones

{{-- Laravel Mix - JS File --}}
{{-- <script src="{{ mix('js/$LOWER_NAME$.js') }}"></script> --}}
{{-- Laravel Vite - JS File --}}
{{-- {{ module_vite('build-$LOWER_NAME$', 'Resources/assets/js/app.js') }} --}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));

import { defineConfig } from 'vite';
//import laravel from 'laravel-vite-plugin';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the commented-out line, should it be active?

src/helpers.php Outdated
/**
* support for vite
*/
function module_vite($module, $asset): \Illuminate\Foundation\Vite
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vite has already been imported, you should be able to use : Vite here.

@wikigods
Copy link
Contributor Author

I think it is ready

@anburocky3
Copy link

I think it is ready

Can't wait to try those.

@MaticSulc
Copy link

Any plans to get this merged?

@dcblogdev dcblogdev merged commit 7560ee1 into nWidart:master Oct 28, 2022
@ikramsyakir
Copy link

ikramsyakir commented Oct 6, 2023

@wikigods can u show me demo how to use it? where should i run npm run dev? on the root project or inside modules folder?

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

Successfully merging this pull request may close these issues.

7 participants