@anthinkingcoder/vue-cli-plugin-ssr
Turn your app into an isomorphic SSR app!
Last updated 2 years ago by anthinkingcoder .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @anthinkingcoder/vue-cli-plugin-ssr 
SYNC missed versions from official npm registry.

@akryum/vue-cli-plugin-ssr

npm npm vue-cli3

Simple Server-Side-Rendering plugin for Vue CLI (Work-in-Progress)

Become a Patreon

Sponsors

Silver

VueSchool logo


:star: Features:

  • Automatic conversion of your project to SSR
  • Integrated express server
  • Vuex store
  • Async routes
  • vue-cli-plugin-apollo support
  • Custom middlewares

:rocket: Roadmap:

  • Automatic conversion of vuex modules to state () {}
  • Integration with CLI UI

Usage

vue add @akryum/ssr
yarn run ssr:serve

To run the app in production:

yarn run ssr:build
yarn run ssr:start

Configuration

Here are the optional settings available in your vue.config.js file:

const path = require('path')

module.exports = {
  pluginOptions: {
    ssr: {
      // Listening port for `serve` command
      port: null,
      // Listening host for `serve` command
      host: null,
      // Entry for each target
      entry: target => `./src/entry-${target}`,
      // Default title
      defaultTitle: 'My app',
      // Path to favicon
      favicon: './public/favicon.ico',
      // Skip some requests from being server-side rendered
      skipRequests: req => req.originalUrl === '/graphql',
      // See https://ssr.vuejs.org/guide/build-config.html#externals-caveats
      nodeExternalsWhitelist: [/\.css$/, /\?vue&type=style/],
      // Function to connect custom middlewares
      extendServer: app => {
        const cookieParser = require('cookie-parser')
        app.use(cookieParser())
      },
      // Paths
      distPath: path.resolve(__dirname, './dist'),
      templatePath: path.resolve(__dirname, './dist/index.html'),
      serviceWorkerPath: path.resolve(__dirname, './dist/service-worker.js'),
    }
  }
}

Current Tags

  • 0.0.4                                ...           latest (2 years ago)

4 Versions

  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 4
Last Month 12
Dependencies (20)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |