[英]Why console log on library doesn't work, when it has been imported to a different react component?
I have a library 'some-library' where i have written a console.log("message from some library") statement in 'some-component.js'.我有一个库'some-library',我在'some-component.js'中写了一个console.log(“来自某个库的消息”)语句。 I have used uglifyjs in this library with default settings.
我在这个库中使用了默认设置的 uglifyjs。 When I import 'some-component' from 'some-library' i do not see 'message from some library'.
当我从“some-library”导入“some-component”时,我没有看到“来自某个库的消息”。 Request you to please help me in this?
请你帮我解决这个问题?
I have tried with npm link, it doesn't work.我试过使用 npm 链接,它不起作用。 Manually copy pasted the libraries(pretty similar to link) in the calling component.
在调用组件中手动复制粘贴库(非常类似于链接)。 But doesn't work.
但不起作用。 Whereas if i put the source code of the library in the calling component.
而如果我将库的源代码放在调用组件中。 I see the message.
我看到消息了。
Sorry, got this sorted.抱歉,已经解决了。 I had used sumologic library and had replaced console log instead of augmenting it.
我使用过 sumologic 库并替换了控制台日志而不是增加它。 The issue is now sorted.
现在问题已解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.