We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有时我们需要将一类包发布到统一的名称作用域下,典型的如 @vue/cli-plugin-vuex、@vue/cli-plugin-router,它们的名称作用域为 "vue"。接下来会介绍如何利用 npm 创建名称作用域。
@vue/cli-plugin-vuex
@vue/cli-plugin-router
按照npm官网的 创建组织步骤 即可。比如我们创建的组织名称为“our-patches”,创建成功后可以通过 https://www.npmjs.com/org/our-patches 查看当前组织下发布的包。
创建项目时,可以通过命令 npm init --scope=organizationName 初始化,按照提示完成即可。如:
npm init --scope=organizationName
npm init --scope=our-patches
组织默认发布为私有的,可以通过下面命令修改为公共包并发布:
npm publish --access=public
我们的“our-patches”作用域名称下有 “postcss-px-to-viewport”包,我们可以通过以下命令安装:
yarn add @our-patches/postcss-px-to-viewport -D
or
npm install @our-patches/postcss-px-to-viewport -D
--完--
The text was updated successfully, but these errors were encountered:
No branches or pull requests
前言
有时我们需要将一类包发布到统一的名称作用域下,典型的如
@vue/cli-plugin-vuex
、@vue/cli-plugin-router
,它们的名称作用域为 "vue"。接下来会介绍如何利用 npm 创建名称作用域。创建组织
按照npm官网的 创建组织步骤 即可。比如我们创建的组织名称为“our-patches”,创建成功后可以通过 https://www.npmjs.com/org/our-patches 查看当前组织下发布的包。
发布名称作用域包
创建项目时,可以通过命令
npm init --scope=organizationName
初始化,按照提示完成即可。如:组织默认发布为私有的,可以通过下面命令修改为公共包并发布:
安装
我们的“our-patches”作用域名称下有 “postcss-px-to-viewport”包,我们可以通过以下命令安装:
or
--完--
The text was updated successfully, but these errors were encountered: