How to test an npm module with peerDependencies?

后端 未结 2 888
暖寄归人
暖寄归人 2021-01-17 09:05

I am new to understand peerDependencies, and I have read the following references seeking as to how to test an npm module contains peerDependencies within i

2条回答
  •  无人及你
    2021-01-17 09:20

    In my case, I developed a library last time that use ioredis as peer dependency. My solution was to put that library as well in dev dependency.

    // package.json
    "peerDependencies": {
        "ioredis": "4.x"
    },
    "devDependencies": {
        "ioredis": "4.x"
    }
    

    it worked well and no issue so far using this approach.

提交回复
热议问题