Closed andycochran closed 4 years ago
@andycochran - unpkg looks like the perfect way to get the css and js onto a CDN. One thing that makes it so nice for this purpose is that it's linked to NPM, so versioned released on NPM map nicely to the unpkg versions.
There should be a way to get this to unpkg while keeping the code repo tidy (not having to check in the dist
directory or having the built files lingering in the root of the repo).
From unpkg's website:
How are you currently publishing the styleguide to npm?
@bfreeds pointed out how it'd be great to serve the
.css
and.js
files via CDN instead of requiring download. This would make prototyping really quick/easy—we could even prototype in e.g. CodePen.I found https://unpkg.com/, which is "a fast, global content delivery network for everything on npm." To use this we'd just need to set up Gulp to compile/minify the two assets to a directory that gets committed.
yarn build
already builds everything todist/
. But we're ignoringdist/
and don't want to commit all these generated files which are mostly for documentation. We could pipe minified css/js files to the root directory when runningyarn build
. Then those could be committed and the minified assets could be served at: