javascript - Laravel mix how to require a jquery library (parsely js) -


i have problem using parsley js (jquery plugin validation) in js file can require wouldn't work $(...).parsley not function , use laravel mix , use sweet alert , works properly, tried change parsley.js :

module.exports = parsley; 

instead of

 return parsley; 

but still have same problem: $(...).parsley not function here code require , try use parsley:

var parsley = require('../libs/parsleyjs/parsley.js'); $('[registerform]').parsley().validate(); 

please , thank you

thank @apokryfos , solved problem, solution install parsley via npm , require :

var parsley = require('parsleyjs')

from package.json instead of

var parsley = require('../libs/parsleyjs/parsley.js');


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -