怎么在扩展编辑器里访问assets的脚本?

assets里写好的脚本,想在扩展编辑器里访问,如果直接require(),会报出“Error: Cannot find module”这样的错误。怎么解决?