2.1.0 • Published 1 year ago

dimmable-loader v2.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Install

npm install
npm run build

Publish

npm publish

Usage

# replace 1.0.3 with the real version number
npm install @zontal/dimmable-loader@1.0.3

Multiple registries

It is likely to fetch project dependencies from both public and private repositories in real life. Somehow npm is not intelligent enough like other package management tools, and the following .npmrc is a way to download package based on scope.

# add those to your local .npmrc(root, user or project level)
registry=https://npm.taobao.org/dist
@zontal:registry=https://zontal-development-521310437492.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/
//zontal-development-521310437492.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/:always-auth=true
//zontal-development-521310437492.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/:_authToken=${CODEARTIFACT_AUTH_TOKEN}
  • registry: the main place for downloading
  • @zontal:registry: download from the target registry if the package scope is zontal
  • //xxx: // doesn't represent comment. this line is not commentable.

Check the registry configuration via

npm config list

CodeArtifacts Login

  • Option I: Using aws cli tool
    aws codeartifact login --tool npm --repository npm --domain zontal-development --domain-owner 521310437492 --region eu-central-1
  • Option II: Manual setup

    # add CODEARTIFACT_AUTH_TOKEN as an environment variable
    export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain zontal-development --domain-owner 521310437492 --region eu-central-1 --query authorizationToken --output text`
    # Copy the configuration into your home directory (~/) or project .npmrc file. If the .npmrc file does not exist, create one.
    registry=https://zontal-development-521310437492.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/
    //zontal-development-521310437492.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/:always-auth=true
    //zontal-development-521310437492.d.codeartifact.eu-central-1.amazonaws.com/npm/npm/:_authToken=${CODEARTIFACT_AUTH_TOKEN}