fis3-hook-module
fis3-hook-module copied to clipboard
globalAsyncAsSync: true 只有在 require('jquery') 才起作用,require(['jquery']) 时无效
<script>
require('jquery');
</script>
globalAsyncAsSync: true
只有在 require('jquery')
才起作用,require(['jquery'])
时无效
亲,你是用 amd 方案吗?
是的
的确,我也遇到了。 是设计如此么?
直接这样的话
<script type="text/javascript">
require('page/index')();
</script>
由于requireJs不允许在全局调用require,所以会报错,如果改成 require(['page/index'])这样的话,资源只能异步加载。。
当 mode 为 amd
且 globalAsyncAsSync
为 true 时,应该是自动变成同步才对,如果不是那就是 bug
@2betop 确认:
// https://github.com/fex-team/fis3-hook-module
fis.hook('module', {
wrap: 'amd',
mode: 'amd',
baseUrl: './static/',
paths: {},
packages: [],
forwardDeclaration: true,
skipBuiltinModules: false,
globalAsyncAsSync: true,
extList: ['.js', '.coffee', '.jsx']
});
好的,今天没有时间修,预计明天修复!
hello, 请更新到 [email protected]
@2betop 好的,3q