admin管理员组文章数量:1292753
I'm trying to bine all of my assets files via Laravel mix
.
I fall in problem when I tried to add bootstrap js in the mix, it said can't resolve propper.js
, but I already add that before it,
Here is my mix configuration code.
var mix = require('laravel-mix');
mix
.js([
'resources/assets/js/jquery.min.js',
'resources/assets/js/popper.min.js',
'resources/assets/js/bootstrap.min.js',
'resources/assets/js/app.js'
], 'public/js/app.js')
.sass('resources/assets/sass/app.scss', 'public/css');
I think I'm doing something in a wrong way, plz make me correct.
I'm trying to bine all of my assets files via Laravel mix
.
I fall in problem when I tried to add bootstrap js in the mix, it said can't resolve propper.js
, but I already add that before it,
Here is my mix configuration code.
var mix = require('laravel-mix');
mix
.js([
'resources/assets/js/jquery.min.js',
'resources/assets/js/popper.min.js',
'resources/assets/js/bootstrap.min.js',
'resources/assets/js/app.js'
], 'public/js/app.js')
.sass('resources/assets/sass/app.scss', 'public/css');
Share Improve this question edited Aug 22, 2018 at 17:12 Bharata 14.2k6 gold badges43 silver badges53 bronze badges asked Jan 15, 2018 at 7:34 King RayhanKing Rayhan 2,4794 gold badges20 silver badges24 bronze badges 2I think I'm doing something in a wrong way, plz make me correct.
- you need to add popper.js i guess you are using bs4?? – Mr. Pyramid Commented Jan 15, 2018 at 7:38
-
1
@Mr.Pyramid Yes, I'm using bootstrap 4. I already add
propper.min.js
beforebootstrap.min.js
image.prntscr./image/8Nm0NgDUSVGFBhoHeuZLVg.png – King Rayhan Commented Jan 15, 2018 at 7:44
1 Answer
Reset to default 9I made it differently a bit.
I downloaded bootstrap using yarn (or you can use npm). As a result you will have a folder node_modules/bootstrap
In the webpack.mix.js I have only app.js
.
In the app.js I have
window.Popper = require('popper.js');
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/
window.$ = window.jQuery = require('jquery');
require('bootstrap');
Note! popper.js and jQuery I also downloaded via yarn (or npm)
本文标签: javascriptCan39t add bootstrapminjs within laravel mixStack Overflow
版权声明:本文标题:javascript - Can't add bootstrap.min.js within laravel mix - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741561526a2385475.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论