简体   繁体   English

谷歌关闭 - goog.require 找不到 goog.structs.PriorityQueue

[英]Google closure - goog.require could not find goog.structs.PriorityQueue

I'm trying to use the PriorityQueue functionality provided by Google Closure, but I can't seem to be able to figure out how to do it without using the Closure Compiler.我正在尝试使用 Google Closure 提供的 PriorityQueue 功能,但如果不使用 Closure 编译器,我似乎无法弄清楚如何做到这一点。 Since I'm not using any custom modules, it seems that I shouldn't need to use the Compiler.由于我没有使用任何自定义模块,看来我不需要使用编译器。

My folder structure is as follows:我的文件夹结构如下:

/Project/html/index.html
/Project/ThirdParty/closure-library

My index.html file contains:我的 index.html 文件包含:

<html>
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <script type="text/javascript" src="../ThirdParty/closure-library/closure/goog/base.js"></script>
    <script>
        goog.require('goog.structs');
        goog.require('goog.structs.PriorityQueue');
    </script>
</head>
<body></body>
</html>

The above however gives me the following:然而,上面给了我以下信息:

goog.require could not find: goog.structs
goog.require could not find: goog.structs.PriorityQueue

I'm a bit at a loss as to why that happens as my code seems to be in line with the example given at https://developers.google.com/closure/library/docs/gettingstarted我有点不知所措,因为我的代码似乎与https://developers.google.com/closure/library/docs/gettingstarted中给出的示例一致

How did you retrieve the library?你是怎么找回图书馆的? If you "npm install" you should have a deps.js file next to base.js which should be everything you need.如果你“npm install”,你应该在 base.js 旁边有一个 deps.js 文件,这应该是你需要的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM