Coder Social home page Coder Social logo

webpack-everything's Introduction

Webpack Everything

This is a vue-cli template that comes with webpack, server side rendering (SSR), route level code splitting, and progressive web app (PWA) capabilities. This template requires SSL in production in order to function properly.

Geting Started

npm install -g vue-cli || yarn global add vue-cli
vue init narkoleptika/webpack-everything example-project
cd example-project
npm install || yarn
npm run dev

Dev server with SSR and HMR will run by default at http://localhost:3000

Production

npm run prod

SSL

You should use SSL. This template assumes the use of encryption by default. You will need to set the following environment variables to run production.

  • SSL - SSL port -- default: 3001
  • CERT - Path to the ssl certificate -- default: ./private/server.crt
  • KEY - Path to the server key -- default: ./private/server.key

Testing SSL

You can self sign some certificates for localhost (Which are handy to have for testing SSL in general)

mkdir private
cd private
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt

No SSL

If you really hate privacy you may set NO_SSL.

Alternatively, you can run

npm run prod--no-ssl

Please note: Service workers require ssl in order to work. If you don't use encryption, you will lose offline capabilities in production.

Environment Vars

  • NODE_ENV
  • PORT - default: 3000
  • HOST - default: localhost
  • SSL - default: 3001
  • KEY - default: ./private/server.key
  • CERT - default: ./private/server.crt
  • NO_SSL

Thanks

webpack-everything's People

Contributors

narkoleptika avatar

Watchers

James Cloos avatar  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.