Skip to content
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

require('template.js')的时候报错,atrTemplate无法模块化 #37

Open
c-zi opened this issue Jun 13, 2016 · 9 comments
Open

require('template.js')的时候报错,atrTemplate无法模块化 #37

c-zi opened this issue Jun 13, 2016 · 9 comments

Comments

@c-zi
Copy link

c-zi commented Jun 13, 2016

不知道为什么,artTemplate无法通过require引入,总是报错
image
上面是我在mod.js里面console.dir('id')的输出结果,有一个很奇怪的 function anonymous()

image

@2betop
Copy link
Contributor

2betop commented Jun 13, 2016

哪一行报错?报错时 id 为何值?

@c-zi
Copy link
Author

c-zi commented Jun 13, 2016

报错 110行 ;报错时id为:function anonymous()

@2betop
Copy link
Contributor

2betop commented Jun 13, 2016

目标文件是 amd 规范的?

@c-zi
Copy link
Author

c-zi commented Jun 13, 2016

这是一个模板引擎,我不太清楚他是否有按照amd规范,我理解是fis-common 插件可以把他包装成commonjs规范的? 我的理解是不是错的? 目标文件还需要按照commonjs规范编写?

@2betop
Copy link
Contributor

2betop commented Jun 13, 2016

是的,目标文件必须是 commonjs 规范的。

@c-zi
Copy link
Author

c-zi commented Jun 13, 2016

我想更改成script标签引入的形式
image
fis-conf.js是这样配置的
image

但是mod.js好像仍然报错
image

@c-zi
Copy link
Author

c-zi commented Jun 13, 2016

image
补充一下fis-conf.js的图。。。刚才放错了 不好意思

@spiroo
Copy link

spiroo commented Sep 29, 2016

@c-zi 我也遇到这个问题,解决了吗?

@c-zi
Copy link
Author

c-zi commented Feb 15, 2017

@spiroo 我改用require.js了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants