我在我的包中添加了moment.js。但是我可以看到moment.js包含在我呈现的页面中。我认为moment.js包含在我添加的任何其他包中。我的问题是,我不能使用包括moment.js在内的内容。当我尝试使用moment.js时,Meteor说,Exception in template helper: ReferenceError: moment is not defined。
undefined,_i: 14-03-2019,_f: undefined,_strict: undefined,(/Users/Hernan/Haip/haip/node_modules/moment/moment.js:320:98) at configFromString (/Users/Hernan/Haip/haip/node_modules/moment/moment.js:2368:15) at conf
正在尝试将moment.js作为es6模块导入。使用的是最新的Chrome版本。import * as moment from './node_modules/moment/src/moment.js'
然而,请求最终会失败,所有的时刻import都试图在没有js扩展的情况下加载它的依赖项。GET http://127.0.0.1:8083/node_modules/moment/src/lib