我的package.json:
...
"scripts": {
"build": "gulp && webpack",
"webpack": "webpack"
},
...
"dependencies": {
"scrollto": "git://github.com/flesler/jquery.scrollTo.git" // ???
}
...
我的骨干观点:
const Backbone = require('backbone');
const _ = require('underscore');
const $ = require('jquery');
require('scrollto'); // ???
...
_handleError(error) {
if (error) {
$('#header').focus();
$(window).scrollTo('#header'); // ????
} else {
...
}
},
...
命令:
gulp && webpack
错误:
Module not found: Error: Cannot resolve module 'scrollto' in /home/me/src/myproject/src/dashboard/static/js/views/query
有什么遗漏或错误吗?
由于
更新
修正: “jquery.scrollto”:“^ 2.0.0”
require('jquery.scrollto');