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 模块。我已将--module标志设置为umd. 我想将此文件的默认导出公开为全局变量。
--module
umd
是否可以在 Typescript 1.8 中将 UMD 模块导出为全局变量?
一种策略是将您的模块重组为命名空间,使其充当全局,并添加一个自定义构建步骤,该步骤将一个添加export default yourNameSpace;到您的文件以创建模块化版本。
export default yourNameSpace;