Skip to content

surge-sh/example-npm-variables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages