2016-12-14 51 views
0

我有一个使用laravel灵药的webpack应用程序。在这个应用程序中,我有一个bootstrap.js文件来初始化我的所有库。那就是:如何要求webpack的系绳?

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');// $ui = require("jquery-ui"); 
/** 
* import twitter bootstrap js library 
*/ 
require('bootstrap-sass'); 
/** 
* import jquery ui 
*/ 
require('jquery-ui-bundle'); 

/** 
* import jquery datatables 
*/ 
require('datatables.net'); 

/** 
* import select2 
*/ 
require('select2'); // globally assign select2 fn to $ element 

/** 
* import d3 
*/ 
require('d3'); 

/** 
dropdowns 
*/ 
require('tether'); 
require('tether-drop'); 

唯一的问题是,当我去建这个,我得到Error: Can't resolve 'tether-drop'。我怎样才能解决这个问题?

谢谢!

+0

我已经删除了[tag:elixir],因为它是标记与编程语言相关的问题的标记。 – mudasobwa

+0

@mudasobwa,这是一个重要的标签,因为它意味着传统上使用的网络包中的配置文件无法使用 –

+0

哦,我明白你的意思了,让我改变它。 –

回答

-1

要使用系绳,您需要在窗口上使用它。

global.Tether = require('tether'); 

现在,您可以将它与其他库一起使用,例如bootstrap @ 4。不要使用导入。

require('bootstrap');