-
Notifications
You must be signed in to change notification settings - Fork 809
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
Jquery and Boostrap previous release configuration issue #842
Comments
You are using What do you meant by bootstrap not working ? Any error ? Did you include all of your build files in welcome.blade.php correctly and in-order ? |
Thank @ankurk91 for the response. please view the javascript console for error. |
Your order of js files in So here is the order -
Also you have included bootstrap css twice. |
Here is my webpack.mix.js file
@ankurk91 I have changed according to your suggestions.
but the error is still there. ** please clone the repo and have a look, I need your kind help.** |
Your You should be having For example: window.$ = window.jQuery = require('jquery') Then in your mix.js('resources/assets/js/app.js', 'app.js') TLDR; use This is mine for a more detailed example:
require('./bootstrap')
require('prismjs')
window.select2 = require('select2')
window.SimpleMDE = require('simplemde')
@import "~font-awesome/scss/font-awesome.scss";
@import "~simplemde/dist/simplemde.min.css";
@import "~prismjs/themes/prism.css";
@import "~select2/dist/css/select2.css";
mix.js([
'resources/assets/js/app.js',
'resources/assets/js/reCaptcha.js',
], 'public/js/app.js')
mix.js('resources/assets/js/frontend.js', 'public/js')
mix.js('resources/assets/js/auth.js', 'public/js')
mix.sass('resources/assets/sass/app.scss', 'public/css')
.sass('resources/assets/sass//auth/auth.scss', 'public/css')
.sass('resources/assets/sass/frontend/frontend.scss', 'public/css') |
@ruchern thank you for an explanation, I know this is not the relevant forum for my silly questions, but I search these since last one and half week and don't understand still. Please also explain these following:
|
@whfamily2006
As @ankurk91 mentioned, yeah you should watch some of the tutorials on Webpack. Laracasts is a good place to start. https://laracasts.com/series/webpack-for-everyone |
@ruchern thank you for explanation. just last thing if I have old version of jquery (jquery.js file downloaded) which not installed via npm so how can I include that download jquery js file in app.js I have seen webpack-for-everyone, laravel-mix on laracast and then I was trying to configure. |
In your mix.scripts('path/to/jquery.min.js', 'public/js') |
You can install old version through npm like this -
|
seems like they have not published that version on npm. npm has these jQuery version available-
|
@ankurk91 And they are unlikely to publish 2.0.2. |
well, it doesn't work totally for me. first, my webpack.mix.js
app.js
it will cause this error
@ankurk91 @ruchern am i making mistake here? |
@endrureza https://github.com/JeffreyWay/laravel-mix/blob/master/docs/autoloading.md // webpack.mix.js
mix.autoload({
'jquery': ['$', 'window.jQuery', 'jQuery'],
}) |
I've done that before webpack.mix.js
app.js
it caused this error
@ankurk91 @ruchern i'm getting more confused Noticement if i change app.js like this app.js
it works ! it's getting fuzzy |
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. |
Description:
Hello Experts
I am a newbie to use web-pack and laravel-mix. I have an old project and with old javascript libraries...
If I use default laravel-mix setting than jquery not loaded and when I add these both libraries manually in the laravel.mix.js file than bootstrap not working...
I have fought since last week but no success.
Steps To Reproduce:
I have uploaded an example in github repository.
link: https://github.com/whfamily2006/laravel-mix-jquery-bootstrap
The text was updated successfully, but these errors were encountered: