You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
In certain cases the handler.js copy resulted in duplicate code in the final project build. As example in the final build, dynamically imported modules might import their dependencies from the original entry-server.js instead of the handler.js copy, this would result in the following chain: 1. handler.js copied from entry-server.js (therefore has code of dep1, dep2, dep3) 2. handler.js dynamically imports SomeComponent.js 2. SomeComponent.js doesnt know about handler.js, imports dep2 from entry-server.js 3. entry-server.js has code for dep1, dep2, dep3 4. The final build includes dep1, dep2 and dep3 from handler.js and from entry-server.js So by removing the handler.js copy and directly importing entry-server.js we can avoid the duplicate dependency code. |
1 year ago | |
---|---|---|
.. | ||
README.md | 2 years ago | |
entry-edge.js | 1 year ago | |
entry.js | 1 year ago | |
index.js | 1 year ago | |
package.json | 1 year ago |
README.md
start-netlify
Adapter for Solid apps that work on in a Netlify function.
This is very experimental; the adapter API isn't at all fleshed out, and things will definitely change.
Edge Functions
Pass the option edge
to your adapter to have it deploy to edge functions instead of standard Netlify functions. Edge Functions have support for streaming as well.
import { defineConfig } from "vite";
import solid from "solid-start/vite";
import netlify from "solid-start-netlify";
export default defineConfig({
plugins: [solid({ adapter: netlify({ edge: true }) })]
});
Configuration
You will be prompted on deploy to choose a publish directory. Type in "netlify".
Alternatively you can setup your netlify.toml to properly locate the built resources.
[build]
publish = "netlify/"
From here you can run npm run build
and then netlify deploy --prod
to deploy.
Important When running edge functions they need to be built first so you can do so by running netlify build
or adding --build
to your deploy cli command.