Git Product home page Git Product logo

cordova's Introduction

vue-pwa-cordova-boilerplate

A full-featured PWA template with webpack, hot-reload, lint-on-save, unit testing & css extraction, that is wrapped in a cordova project.

Documentation

  • This template builds on top of the main webpack template, so please refer to the webpack template docs.

  • Check out the official Vue.js guide for general information about Vue that is not specific to this template.

Usage

This is a project template for vue-cli. It is recommended to use npm 3+ or yarn for a more efficient dependency tree.

$ npm install -g vue-cli
$ vue init vuetifyjs/cordova my-project
$ cd my-project
$ npm install
$ npm run dev
$ cordova platform add android
$ cordova platform add ios
$ npm run android
$ npm run ios

If port 8080 is already in use on your machine you must change the port number in /config/index.js. Otherwise npm run dev will fail.

What's Included

  • Service Worker precaching of application shell + static assets (prod)
  • Script (async chunk) preloading using <link rel="preload">
  • Web Application Manifest + favicons
  • Mobile-friendly meta-viewport
  • Lighthouse score of 90+/100
  • npm run dev: first-in-class development experience.

    • Webpack + vue-loader for single file Vue components.
    • State preserving hot-reload
    • State preserving compilation error overlay
    • Lint-on-save with ESLint
    • Source maps
  • npm run build: Production ready build.

    • JavaScript minified with UglifyJS.
    • HTML minified with html-minifier.
    • CSS across all components extracted into a single file and minified with cssnano.
    • All static assets compiled with version hashes for efficient long-term caching, and a production index.html is auto-generated with proper URLs to these generated assets.
    • Use npm run build --reportto build with bundle size analytics.
    • Generates a Service Worker for offline caching your static assets using sw-precache-webpack-plugin
  • npm run unit: Unit tests run in PhantomJS with Karma + Mocha + karma-webpack.

    • Supports ES2015+ in test files.
    • Supports all webpack loaders.
    • Easy mock injection.
  • npm run e2e: End-to-end tests with Nightwatch.

    • Run tests in multiple browsers in parallel.
    • Works with one command out of the box:
      • Selenium and chromedriver dependencies automatically handled.
      • Automatically spawns the Selenium server.

Fork It And Make Your Own

You can fork this repo to create your own boilerplate, and use it with vue-cli:

vue init username/repo my-project

Reminder about android package naming conventions

Use these Naming conventions for reverse doamin name to prevent build failure. If you've already initialised your project this can be changed in config.xml.

For iPhone X

This thread helps understanding the status bar changes made for iPhone X.

It is recommended to install cordova-plugin-statusbar, and add these configurations to your config.xml as required:

  <preference name="StatusBarOverlaysWebView" value="false" />
  <platform name="android">
      <preference name="StatusBarBackgroundColor" value="#005790" />
  </platform>
  <platform name="ios">
      <preference name="StatusBarBackgroundColor" value="#1a78b4" />
  </platform>

Android spec requires a darker color from your apps primary theme color, hence the different colors for the different platforms.

Android headercolor

The android header-color is the color of the taskbar when minimising the app. This can be altered by installing cordova-plugin-headercolor.

cordova's People

Contributors

acdcjunior avatar addyosmani avatar anubhav7495 avatar cairin avatar charlesokwuagwu avatar codincat avatar danielpintilei avatar danikane avatar eddyerburgh avatar ffloriel avatar johnleider avatar kaelwd avatar ksankumar avatar maoberlehner avatar markpieszak avatar maurop123 avatar naramsim avatar nekosaur avatar ragingwind avatar sudo-suhas avatar yyx990803 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.