使用amd-optimize 打包amd规范的js代码,报错如下:
events.js:154
throw er; // Unhandled 'error' event
^
Error: No file for module 'handlebars' found.
其中handlebars文件其实是写到了页面中的script标签中的,在require_config.js中的配置是
require.config({ /*requre config*/ baseUrl: "http://js.xxx.com/channel/www/", paths:{ 'handlebars':'http://js.xxx.com/handlebar.min', } });
并把require_config.js这个配置文件传入了amd-optimize的options中,'configFile':path.join('xxx/require_config.js'),这么写是错误了,应该写成'handlebars':'empty:',因为这个handlebars是在sript标签中单独引入的