Comments (9)
When you run sapper build
, Sapper creates a build
directory containing your app. To run it, you need to do sapper start
— this sets up all the necessary environment variables and runs build/server.js
. (Note that you can also do sapper build custom-dir
and sapper start custom-dir
, if you want to use a destination other than build
.)
Your files still exist in the assets
directory. So to deploy it, you just need to put your build
and assets
dir on a server somewhere, npm install
dependencies, and do sapper start
. The exact details will differ from one platform to the next, but that's essentially how it works. You don't need do deploy the app
or routes
directories. Hope this helps!
from sapper-template.
Apologies for commenting on a closed issue, but given the latest updates, what files need to be included to run in Prod?
The below Dockerfile works great, but produces a heavy container (39MB). Any suggestions for how to slim this down? I've tried some of the examples on GH to use COPY --from=0
, but can't get the right mix of files to get it to deploy (K8s v1.15.X).
FROM node:12-alpine
WORKDIR /app
COPY . .
RUN npm install --save
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]
from sapper-template.
@rakia See https://sapper.svelte.technology/guide#exporting
from sapper-template.
It's now https://sapper.svelte.dev/docs#Exporting
from sapper-template.
Hi @Rich-Harris,
how about deploying the application in server that does not support node.js? so, I can't use npm install.
I just need a folder like /dist that I just have to copy/paste under an apache server and the app will be deployed automatically.
from sapper-template.
Brilliant! Thank you @Rich-Harris
from sapper-template.
thank you @Conduitry, you've answered my question :)
from sapper-template.
To build your app, you need the entire contents of your project as well as all of the dependencies (prod and dev).
To run your app in production, you need static
, __sapper__/build
, and all of your prod dependencies.
You can do this with a two-stage Dockerfile. Or you can even use a three-stage Dockerfile if you want your final image to use a base image that doesn't include any package managers.
The Svelte site has the build itself happen outside of Docker, but then uses a two-stage Docker build, the first of which is used to install npm dependencies, which are then copied into the second, which contains only Node and not npm or Yarn.
from sapper-template.
@Conduitry that link above (#exporting) is 404
from sapper-template.
Related Issues (20)
- Set start_url in manifest.json correctly
- How to publish a production site to run in an external HTTP server like Nginx? HOT 1
- npm run export error: Cannot find module sapper HOT 1
- Cannot use import statement outside a module HOT 9
- Include setupTypeScript script only in Rollup branch
- DRY out default Webpack config
- Svelte-check returns error "Cannot find module" on image import when using TypeScript HOT 2
- "Cannot use namespace 'Preload' as a type" error when typing preload function HOT 7
- Error: Unexpected character '�' (Note that you need plugins to import files that are not JavaScript) HOT 5
- Module '"*.jpg"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
- Sapper Typescipt, can't spin up dev server HOT 4
- Page doesn't load. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘TypeError: NetworkError when attempting to fetch resource
- css sourcemap broken HOT 1
- sapper export to electron, broken paths
- Service worker warns: No directory provided. Skipping CSS generation HOT 11
- Types in latest Sapper incompatible with Express HOT 1
- Bug: Rollup plugin-replace: preventAssignment set to "false" HOT 11
- Getting started tutorial: Live reload not working HOT 3
- Upgrade webpack template to use svelte-loader 3.0.0 HOT 3
- Type errors after converting to TypeScript HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sapper-template.