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

How to make it work on vite #618

Open
chan15 opened this issue Jul 17, 2024 · 0 comments
Open

How to make it work on vite #618

chan15 opened this issue Jul 17, 2024 · 0 comments

Comments

@chan15
Copy link

chan15 commented Jul 17, 2024

Description:

I used vite as the pack tool, there is my vite config below:

vite.config.js

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import inject from "@rollup/plugin-inject";
import requireTransform from 'vite-plugin-require-transform';

export default defineConfig({
    plugins: [
        requireTransform({
            fileRegex: /.(js|jsx|ts|tsx)$/,
        }),
        inject({
            $: 'jquery',
            jQuery: 'jquery',
        }),
        laravel({
            input: [
                'resources/css/chan.scss',
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
});

app.js

import "jquery-validation";
import "jquery.cookie";
import "jquery-form";

$(function() {
    $('#frm').validate();
    $('#frm').ajaxForm({
        success: function(response) {
            console.log(response);
        }
    });
});

I got TypeError: Ge(...).ajaxForm is not a function, other old jquery plugins works perfectly, need your help to solve this issue, thanks.

@chan15 chan15 changed the title How to make it work at vite How to make it work on vite Jul 17, 2024
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

1 participant