fis3-hook-node_modules icon indicating copy to clipboard operation
fis3-hook-node_modules copied to clipboard

require node_module 里面的js文件,好像加载不到

Open xiachaoxulu opened this issue 8 years ago • 10 comments

我的项目里,用的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

xiachaoxulu avatar Aug 26 '16 08:08 xiachaoxulu

安装 babel-runtime 重试呗

2betop avatar Aug 26 '16 08:08 2betop

@2betop 您是说babel-plugin-transform-runtime 插件。 跟这个有啥关系呢。 请教

xiachaoxulu avatar Aug 26 '16 08:08 xiachaoxulu

他是编译的时候没找到这个包,报的错。npm install babel-runtime --save 后就能识别了。

2betop avatar Aug 26 '16 09:08 2betop

@2betop 那个错,是mod.js 在浏览器报错的。 我刚才装了 babel-runtime 不管用。

xiachaoxulu avatar Aug 26 '16 09:08 xiachaoxulu

qq 20160826170524

xiachaoxulu avatar Aug 26 '16 11:08 xiachaoxulu

从你的截图看,你确实没有安装 babel-runtime

2betop avatar Aug 27 '16 02:08 2betop

qq 20160828114616

xiachaoxulu avatar Aug 28 '16 03:08 xiachaoxulu

@2betop 生成的 all in one 文件。 11

xiachaoxulu avatar Aug 28 '16 03:08 xiachaoxulu

是不是因为是 link 的方式安装的?不要用 cnpm 安装。link 在 fis 里面处理不好。

2betop avatar Aug 28 '16 14:08 2betop

link 坑太多,最好在文档备注下

a526672351 avatar Sep 12 '17 01:09 a526672351