Skip to content

Instantly share code, notes, and snippets.

@jpsc
Last active September 21, 2017 10:00
Show Gist options
  • Save jpsc/b04323e689e8051c5b8640278f8ce95f to your computer and use it in GitHub Desktop.
Save jpsc/b04323e689e8051c5b8640278f8ce95f to your computer and use it in GitHub Desktop.
An example on how to run grunticon without grunt dependency
scripts {
"generate:icons": "npm-run-all icons:*",
"install-icon-generator": "npm i grunticon-cli phantomjs rimraf svgo",
"icons:optimize-svg": "svgo -f ./Views/Shared/Icons/RawIcons -o ./tmp ",
"icons:grunticon": "grunticon ./tmp ./Views/Shared/Icons/Assets --config=./Scripts/generate-icons/config.js",
"icons:clean": "rimraf ./tmp"
}
@jbmoelker
Copy link

Nice!!

Could you also share the generate-icons/config.js?

And few small things:

  • scripts -> "scripts":
  • "icons:clean": "rimraf ./tmp" -> "posticons:grunticon": "rimraf ./tmp"
  • "generate:icons": "npm-run-all icons:*" -> "icons": "npm run icons:optimize && icons:grunticon"? Is there a better name than "grunticon"?
  • move install-icon-generator to separate devDependencies?
  • why is phantomjs needed directly? shouldn't one of the other modules just install that as its dependency?

@jpsc
Copy link
Author

jpsc commented Apr 20, 2016

@jbmoelker phantomjs is a peerDependency of grunticon-cli is not installed by default on npm3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment