Coder Social home page Coder Social logo

newsroom's Introduction

sapper-template

This is a blank project for sapper to be deployed on firebase

  • firebase functions serve the initial ssr load
  • static files are handled by firebase hosting
  • you can still dev locally (just need to try with firebase serve before deploying)

Get started

npm install
cd functions && npm install

Update all .example files from the config folder with your firebase credentials, then remove the .example extension. Next, update src/firebase.config.example with your client firebase credentials and then remove the .example extension.

yarn dev

You should be good to go

Structure

Sapper expects to find two directories in the root of your project โ€” src and static. "functions" directory is meant for firebase functions "config" directory is meant for firebase config files

static

The static directory contains any static assets that should be available. These are served using sirv. !Only in dev mode!

In your service-worker.js file, you can import these as files from the generated manifest...

import { files } from '../__sapper__/service-worker.js';

...so that you can cache them (though you can choose not to, for example if you don't want to cache very large files). TODO figure out if firebase caching renders this process useless

Bundler config

Added rollup-plugin-node-globals

Production mode and deployment

To start a production version of your app, run npm run build && npm start. This will disable live reloading, and activate the appropriate bundler plugins.

You can deploy your application to firebase with npm run deploy or yarn deploy this runs the predeploy.js script then deploys to firebase functions and hosting

predeploy.js just copies sapper to the functions folder

Bugs and feedback

Please let me know if this works for you or any improvements you would like to see

newsroom's People

Contributors

mfeyx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.