UNPKG

depl.to

Version:

Serve an SPA with node_modules and zero config as a service

25 lines (17 loc) 946 B
# depl.to > Serve an SPA with node_modules and zero config as a service (wip) First, go to [depl.to](https://depl.to) and connect with github. Then, this is usage of depl.to from start to finish: 1. `mkdir example && cd example` 2. `npm init` 3. `git init` 4. `git remote add origin git@github.com:owner/repo.git` 5. `touch index.html` 6. Edit `index.html` to your liking. 7. Optional: Use `npm i grainbox` to get SPA capabilities. 8. `git add . && git commit -m "init"` 9. `git push -u origin master` Your website is now available at `https://repo.owner.depl.to` ### How it works depl.to supports import statements with bare specifiers so that the browser can import from `node_modules`. It does this by transforming files during a request using [`web-imports`](https://npmjs.com/web-imports). Using the `package.json` in the github repo, it generates a copy of `node_modules` in a cache, and that is where `node_modules` is served from.