[问题] jsoneditor in webpack

楼主: brandyjohn (hailcpp)   2017-08-07 18:38:13
各位版大好, 小弟刚学写网页,
最近接触webpack觉得非常方便,
但是又很容遇到设定上问题,(实在是又爱又恨)
这次遇到在使用jsoneditor 这个lib时遇到一些问题,
(
我用的lib是yarn安装后, 根据github上的指示,
https://github.com/josdejong/jsoneditor#custom-builds
build 出 jsoneditor.custom.js后放在 node_modules底下的jsoneditor根目录
这一动一直不确定对不对, 但是看到custom.js中有require(".src/xxxx")
就先这样放了
)
请各位大大不吝指导.
目录架构如下:
E:.
| .gitignore
| Jenkinsfile
| package.json
| webpack.config.js
| webpack.config.prod.js
| yarn.lock
|
+
作者: freeccc (自由的ccc)   2017-08-09 17:00:00
我把jsoneditor npm install下来没有看到./node_modules/jsoneditor/jsoneditor.custom.js 耶喔喔我漏看你最前面有自己 build 的部分,不好意思如果改用 import JSONEditor from 'jsoneditor' 呢?
作者: chatnoir (对不起)   2017-08-09 23:08:00
我刚用楼上的写法是可以的,原po是不是误用{}?
楼主: brandyjohn (hailcpp)   2017-08-17 12:39:00
我最后是用require来处理,我猜应该跟移除{}有一样效果
作者: dlikeayu (太阳拳vs野球拳)   2017-08-25 10:14:00
import

Links booklink

Contact Us: admin [ a t ] ucptt.com