[英]jquery-ui distribution file
I started using grunt to compile my assets, instead of loading with <script>
. 我开始使用grunt来编译我的资产,而不是使用
<script>
加载。 I load it like this: 我像这样加载它:
var libraries = [
/* jQuery */
"node_modules/jquery/dist/jquery.js",
/* jQuery UI */
"node_modules/jquery-ui/jquery-ui.js",
}
And 和
concat: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */',
},
js_libs: {
src: libraries,
dest: 'dist/js/libs.js'
}
}
Loading jquery-ui, because I could not find a normal distribution file, it throws on console: 加载jquery-ui,因为我找不到正常的分发文件,它会抛出控制台:
libs.js?version=1461946469:9844 Uncaught ReferenceError: require is not defined
libs.js?version = 1461946469:9844 Uncaught ReferenceError:require未定义
And that line of code is: 那行代码是:
var jQuery = require('jquery');
Jquery-UI has no distribution files in their package. Jquery-UI在其包中没有分发文件。
A better way here, is to use webpack
to build a single minified uglified bundle file. 这里更好的方法是使用
webpack
构建一个缩小的uglified捆绑文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.