我在为我的NPM添加Summernote时遇到了麻烦。我想使用NPM,以便所有JS和CSS文件都在一个文件中。不幸的是,当我在Laravel-mix和Webpack中添加它时,我无法使Summernote工作。我知道当我在main.blade.php
中添加脚本链接时,它可以正常工作。问题是jQuery始终位于我的app.js
文件的末尾,但我需要将Summernote作为最后一个。
webpack.mix.js
mix.js([
'resources/assets/js/app.js',
// I tried to add a new file with only summernote required to get it to be the
// last package to be in the app.js but no luck.
//'resources/assets/js/summernote.js'
], 'public/js');
资产/ JS / app.js
require('./bootstrap');
// Menu
require('./sidebar.js');
./自举
window._ = require('lodash');
/**
* 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');
// Packages
require('bootstrap-sass');
require('owl.carousel');
require('perfect-scrollbar/jquery')(window.$);
require('datatables.net-bs');
require('codemirror');
require('summernote');
require('select2');
// Set some global options for select2
$.fn.select2.defaults.set("theme", "bootstrap");
我知道所有版本的jQuery,bootstrap等都在一起工作,所以这不是问题。我只需要在jquery下面获取summernote js代码......