menreiki2
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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}
  `;
};
 

Package Sidebar

Install

npm i menreiki2

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

66.8 kB

Total Files

59

Last publish

Collaborators

  • bloody-ux