5
我的影片是与引导4.内置在这个应用程序的应用程序,我有一个凉亭文件,有以下几点:捆绑引导4 - 引导提示需要特瑟
bower.json
{
"name": "myApp",
"version": "1.0.0",
"dependencies": {
"jquery": "2.1.4",
"tether": "1.2.0",
"bootstrap": "v4.0.0-alpha.5"
},
"private": true
}
我想将这些文件与几个自定义JavaScript文件捆绑在一起。在试图做到这一点,我有以下咕嘟咕嘟任务:
gulpfile.js
gulp.task('bundleJs', function() {
var jsFiles = [
'./bower_components/jquery/dist/jquery.min.js',
'./bower_components/tether/dist/tether.min.js',
'./bower_components/bootstrap/dist/js/bootstrap.min.js',
'./public/core.js',
'./public/utils.js'
];
return gulp.src(jsFiles)
.pipe(concat('bundle.js'))
.pipe(gulp.dest('./public/js'))
;
});
然后,在我的网页,我引用这样的文件:
的index.html
<script type="text/javascript" src="/public/js/bundle.js"></script>
我加载网页,我可以看到bundle.js已成功加载。然而,在控制台窗口中,我看到了以下错误:
未捕获的错误:引导提示需要特瑟
我认为,这就是为什么我的汉堡包菜单不再适用于移动。我的问题是,有没有办法将这些文件捆绑在一起?或者,我是否需要单独加载每个?
是对你的包的加载后定义** **连接臂变量? –
tether.min.js文件的内容已被复制到bundle.js中。内容出现在Bootstrap.min.js文件的内容之前。 – user687554
尝试使用最新的引导程序'4.0.0-alpha.6'而不是alpha 5.并且最新的Tether版本为'1.4'。如果我使用alpha5,我的工具提示也不起作用。 –