laravel打包js文件问题,站长是怎么弄的?

以前都是用cdn,现尝试打包到一个js文件中,
app.js文件中require()要打包的文件,例如下面的tethercropper

require('tether');//因为tether要在Bootstrap的前面引入,所以放在./bootstrap前面,但仍会报错
require('./bootstrap');

require('cropper');

Vue.component('example', require('./components/Example.vue'));

const app = new Vue({
    el: 'body'
});

运行gulp,这一步倒是没什么问题,但是浏览器运行时却有错误:

Uncaught Error: Bootstrap tooltips require Tether
Uncaught TypeError: $image.cropper is not a function

怎么一回事?

本站的js好像是打包到一个文件的,站长是怎么弄的?

备注一下:

上面bootstrapBootstrap是两个东西, bootstrapresources/assets/js的一个文件bootstrap.js,Bootstrap` 是 Twitter的UI.

perfectboook

require('tether');这句改成window.Tether = require('tether');试试。下面那个jquery上面的方法不确定怎么做。这东西我也有点迷糊。

canihelpyou 回复 perfectboook

不行。…