Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@yawnxyz/somewhat-questionable
Advanced tools
Vercel builder for Sapper with SSR enabled
Run npx vercel-sapper
on an existing project.
Or create a new project with npx vercel-sapper my-project
🧪 This feature is experimental, let us know what you think => https://github.com/thgh/vercel-sapper/pull/47
You must make 3 changes to your project to get started:
vercel-sapper
as builder in vercel.json
src/server.js
__sapper__
To install a working example of a vercel-sapper template ready for deployment or development, see the examples
directory.
cd examples/sapper-template
node install.js
vercel-sapper
as builder in vercel.json
{
"version": 2,
"builds": [{ "src": "package.json", "use": "vercel-sapper" }]
}
src/server.js
const app = express() // or polka()
// app.use(...)
// app.listen(...)
export default app
__sapper__
Example .vercelignore
:
__sapper__
node_modules
Consider also ignoring the cypress
folder if you are not running tests.
Run vercel
to build and deploy your project. You can install the vercel cli by running npm i -g vercel
Run sapper dev
for local development. vercel dev
does not work for local development
You can change the Node.js version with the engines field.
Example package.json
{
"engines": {
"node": "12.x"
}
}
__sapper__
folderThe static folder is always hosted on the Vercel CDN. Before v0.42 it was also included in the lambda function. Here is how to include it again:
Example vercel.json
{
"version": 2,
"builds": [
{
"src": "package.json",
"use": "vercel-sapper",
"config": {
"include": ["static"]
}
}
]
}
You can change the amount of memory your lambda runs with. This is useful to optimise costs.
Note that reducing memory also reduces the amount of CPU available to the lambda, so try some values before you optimise too much.
{
"version": 2,
"builds": [
{
"src": "package.json",
"use": "vercel-sapper",
"config": {
"memory": 3008
}
}
]
}
Where builds[].config.memory
can be any value allowed by AWS Lambda.
Useful if you are building the project on CI, and then want to just push the compiled source.
Recommended .vercelignore
:
__sapper__/dev
__sapper__/export
cypress
node_modules
Example vercel.json
{
"version": 2,
"builds": [
{
"src": "package.json",
"use": "vercel-sapper",
"config": {
"build": false
}
}
]
}
Please see CHANGELOG for more information on what has changed recently.
Contributions and feedback are very welcome.
This project aims to enable developers to deploy to Vercel with minimal config. New features should be in line with other builders like now-next. Please see the now Developer Reference for more info.
FAQs
Vercel builder for Sapper with SSR enabled
We found that @yawnxyz/somewhat-questionable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.