Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发降价转换器应用程序,并使用 NPM 包摊牌。在我的 app.js 文件中,我有一个 var showdown = require('showdown'); 正在正确添加的文件。在我的前端,我需要一个需要使用它的 script.js。但是,它不识别摊牌变量。如果我使用上面包含我的 script.js 的摊牌 cdn,则该代码可以完美运行。如何使我的 NPM 模块可以在整个项目中使用?
var showdown = require('showdown');
这是你的答案。我已经分叉了你的 git repo 并进行了更改。