Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 921 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 921 Bytes

npm variables example

An example using npm package variables and Surge in an npm run script.

Getting started

Deploy to Surge with an npm run script: npm run deploy.

Use other keys within your package.json file as part of your npm run script. Since you already have metadata like the URL of the project, in the package.json, why not make it part of your run script too?

"scripts": {
  "deploy": "surge --domain $npm_package_homepage"
}

You might even make the main filed the source directory:

"script": {
  "deploy": "surge --project $npm_package_main --domain $npm_package_homepage"
}

The variable-based approach was inspired by this tweet from @juice49.

License

The MIT License (MIT)

Copyright © 2015 Chloi Inc.