[Yarn] Use Yarn to Create an Alternative Import Name of an Installed Library
2017-06-13 01:22
477 查看
In this lesson we'll show how to use yarn to alias the names of same npm libraries but install different versions. This could allow for easy migrating from one library version to an upgraded version.
You can install lib by using Yarn and give the lib an alias name:
Then you can use it:
Note: it only works when you and your team use Yarn, npm won't work.
You can install lib by using Yarn and give the lib an alias name:
yarn add lodash3@npm:lodash^3 // install lodash version 3 yarn add lodash4@npm:lodash^4 // install lodash version 4
Then you can use it:
import lodash3 from 'lodash3'; import lodash4 from 'lodash4';
Note: it only works when you and your team use Yarn, npm won't work.
相关文章推荐
- How to use an Outlook Object Model from Visual C++ by using a #import statement
- How to use an ActiveX script task to create a loop in DTS
- [zz]How to use Fiddler and HTTP replay to have an offline copy of your site
- An effective way to use pattern to instead of multiple if else statements
- Use of @OneToMany or @ManyToMany targeting an unmapped class: com.lin.bean.product.ProductInfo.style
- How to use the "Enties Generator" tool to create an entities project.
- How to solve the problem "A project with an Output Type of Class Library cannot be started directly "
- 转载:How to create an automation project using MFC and a type library
- No way to map to an envelop schema without use of orchiestration.
- Unable to create an instance of the Java Virtual Machine
- How to use an ActiveX script task to import data into a new Excel file
- 修复JDeveloper 11g 的 Unable to create an instance of the Java Virtual Machine问题
- An incompatible version 1.1.1 of the Apache Tomcat Native library is installed, while Tomcat requires version 1.1.3
- Know When to Use an Active Object Instead of a Mutex
- How to create a DLL library in C and then use it with C#
- sqldeveloper启动时报 Unable to create an instance of the Java Virtual Machine Located at path: ../../jdk/jre/bin/client/jvm.dll 错误
- How to use Wise SetupCapture in the Wise Packager for Deployment Server to create an MSI
- A step-by-step guide to the use of the Intel OpenCV library and the Microsoft DirectShow technology
- sqldeveloper 启动时报 Unable to create an instance of the Java Virtual Machine Located at path: ...
- Oracle SQL Developer - Unable to create an instance of the Java Virtual Machine