fis3-hook-node_modules
fis3-hook-node_modules copied to clipboard
require node_module 里面的js文件,好像加载不到
我的项目里,用的Object.assign方法,当然用的babel 进行转码。 babel 转码成
reqiure('babel-runtime/core-js/object/assign').
随后fis3 开始用postpackager 进行打包。 设置的属性是 all in one.
遗憾的是,all in one 的文件里面 没有该段 代码。到此,我开始怀疑,是fis3的postpackager 不能识别 node_modules的资源。
然后我 看到了 fis3-hook-node_modules 插件。
按照readme.md 的教程,已配置完成。 然而...Uncaught [ModJS] Cannot find module babel-runtime/core-js/object/assign
安装 babel-runtime
重试呗
@2betop 您是说babel-plugin-transform-runtime 插件。 跟这个有啥关系呢。 请教
他是编译的时候没找到这个包,报的错。npm install babel-runtime --save
后就能识别了。
@2betop 那个错,是mod.js 在浏览器报错的。 我刚才装了 babel-runtime 不管用。
从你的截图看,你确实没有安装 babel-runtime
@2betop 生成的 all in one 文件。
是不是因为是 link 的方式安装的?不要用 cnpm 安装。link 在 fis 里面处理不好。
link 坑太多,最好在文档备注下