-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
图片src中的http://xxx处理错误 #18
Comments
查明是工具在编译前压缩处理有问题,已经修复,并且示例也放了一张图片。 模板引擎本身已经很稳定,也经历大大大小小的商业项目考验。编译工具刚刚由DEMO转为测试版,潜在的问题比较多。后面我会在商业项目中去检验他,逐步完善。 |
再提个优化建议:一个文件里多次include进同样的文件时候,会生成几个相同的依赖: var dependencies = { "./include/_banner": require("./include/_banner"), "./include/waterfall": require("./include/waterfall"), "./include/waterfall": require("./include/waterfall") }; 例如有重复的waterfall依赖,虽然不会抛错,但毕竟不太好。。 |
好的,下次更新将优化。现在旅行途中,十天后回来处理此问题 |
再反馈个感觉比较严重的问题吧: var helpers = require("./$helpers"); helpers.$render = function (id, data) { return dependencies[id](data); }; 这个代码里的 dependencies 引用的对象 一直 是最后一次require进去的模块的 dependencies对象。例如: var a = require("./a"); var b = require("./b"); var c = require("./c"); 如果在代码初始化时相继执行了以上三句,dependencies对象就会是c模块里的dependencies,而调用a,b都是执行的c里的dependencies,这个就直接造成错误了。这个应该是把helpers抽离出来,并且用了helper.$render方法的缘故,这方面的设计上是不是应该再斟酌一下? |
确认是个Bug。我决定在模块返回的函数中重写helpers.$render引用,确保它在当前上下文中,明天将更新代码解决上面两个Bug |
已经更新代码,问题解决 |
本不想再提了,但这个bug很明显。例如<img src="http://xxx" /> http后边处理错误。通过compile.cmd编译后出的问题,应该是正则处理错误。。
The text was updated successfully, but these errors were encountered: