menreiki2
ssr with react
Last updated a year ago by bloody-ux .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install menreiki2 
SYNC missed versions from official npm registry.

how to use

npm install -g menreiki
menreiki init

todo

add more docs

default menreiki.config.js


// commonjs module

// whether mock server is enabled
exports.proxy = undefined;

// whether enabled server side rendering
exports.ssr = true;


// dev server host, default: localhost
exports.host = 'localhost'

// babel config for client side
exports.babel = function(babelConfig) {
  return babelConfig;
};

// babel config for server side
exports.babelServer = function(babelConfig) {
  return babelConfig;
};

// webpack config for client side
exports.webpack = function(webpackConfig) {
  return webpackConfig;
};

// webpack config for server side
exports.webpackServer = function(webpackConfig) {
  return webpackConfig;
};

exports.template = function({
  pageName,
  styles,
  cssHash,
  js,
  initalState,
  elementId,
  markup,
}) {
  return `
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="UTF-8">
        <meta name="pagename" content="${pageName}">
        <link rel="icon" href="https://zos.alipayobjects.com/rmsportal/nDgBIDOgapQuIrT.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="https://zos.alipayobjects.com/rmsportal/nDgBIDOgapQuIrT.ico" type="image/x-icon" />
        <title>${pageName}</title>
        ${styles}
        <script>window.__INITIAL_DATA__ = ${initalState}</script>
      </head>
      <body>
        <div id="${elementId}">${markup}</div>
      </body>
      ${cssHash}
      ${js}
  `;
};

Current Tags

  • 0.0.1                                ...           latest (a year ago)

1 Versions

  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 1
Dependencies (70)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |